Skip to content

Commit 2b93fe6

Browse files
committed
Merge tag 'gpio-fixes-for-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio fixes from Bartosz Golaszewski: - fix a build error in gpio-vf610 - fix a null-pointer dereference in the GPIO character device code * tag 'gpio-fixes-for-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpiolib: cdev: fix null pointer dereference in linereq_free() gpio: vf610: fix compilation error
2 parents a471da3 + c8e27a4 commit 2b93fe6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/gpio/gpio-vf610.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/of.h>
2020
#include <linux/of_device.h>
2121
#include <linux/of_irq.h>
22+
#include <linux/pinctrl/consumer.h>
2223

2324
#define VF610_GPIO_PER_PORT 32
2425

drivers/gpio/gpiolib-cdev.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,11 +1460,12 @@ static ssize_t linereq_read(struct file *file,
14601460
static void linereq_free(struct linereq *lr)
14611461
{
14621462
unsigned int i;
1463-
bool hte;
1463+
bool hte = false;
14641464

14651465
for (i = 0; i < lr->num_lines; i++) {
1466-
hte = !!test_bit(FLAG_EVENT_CLOCK_HTE,
1467-
&lr->lines[i].desc->flags);
1466+
if (lr->lines[i].desc)
1467+
hte = !!test_bit(FLAG_EVENT_CLOCK_HTE,
1468+
&lr->lines[i].desc->flags);
14681469
edge_detector_stop(&lr->lines[i], hte);
14691470
if (lr->lines[i].desc)
14701471
gpiod_free(lr->lines[i].desc);

0 commit comments

Comments
 (0)