Commit 2b93fe64 authored by Linus Torvalds's avatar Linus Torvalds

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
parents a471da31 c8e27a4a
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/pinctrl/consumer.h>
#define VF610_GPIO_PER_PORT 32 #define VF610_GPIO_PER_PORT 32
......
...@@ -1460,11 +1460,12 @@ static ssize_t linereq_read(struct file *file, ...@@ -1460,11 +1460,12 @@ static ssize_t linereq_read(struct file *file,
static void linereq_free(struct linereq *lr) static void linereq_free(struct linereq *lr)
{ {
unsigned int i; unsigned int i;
bool hte; bool hte = false;
for (i = 0; i < lr->num_lines; i++) { for (i = 0; i < lr->num_lines; i++) {
hte = !!test_bit(FLAG_EVENT_CLOCK_HTE, if (lr->lines[i].desc)
&lr->lines[i].desc->flags); hte = !!test_bit(FLAG_EVENT_CLOCK_HTE,
&lr->lines[i].desc->flags);
edge_detector_stop(&lr->lines[i], hte); edge_detector_stop(&lr->lines[i], hte);
if (lr->lines[i].desc) if (lr->lines[i].desc)
gpiod_free(lr->lines[i].desc); gpiod_free(lr->lines[i].desc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment