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
Unified · Split
| @@ -19,6 +19,7 @@ · 18 unmodified lines | ||
| 19 | 19 | #include <linux/of.h> |
| 20 | 20 | #include <linux/of_device.h> |
| 21 | 21 | #include <linux/of_irq.h> |
| 22 | +#include <linux/pinctrl/consumer.h> | |
| 22 | 23 | |
| 23 | 24 | #define VF610_GPIO_PER_PORT 32 |
| 24 | 25 | |
| @@ -1460,11 +1460,12 @@ static ssize_t linereq_read(struct file *file, · 1459 unmodified lines | ||
| 1460 | 1460 | static void linereq_free(struct linereq *lr) |
| 1461 | 1461 | { |
| 1462 | 1462 | unsigned int i; |
| 1463 | − bool hte; | |
| 1463 | + bool hte = false; | |
| 1464 | 1464 | |
| 1465 | 1465 | 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); | |
| 1468 | 1469 | edge_detector_stop(&lr->lines[i], hte); |
| 1469 | 1470 | if (lr->lines[i].desc) |
| 1470 | 1471 | gpiod_free(lr->lines[i].desc); |