gpio fixes for v5.19-rc6

- fix a build error in gpio-vf610
 - fix a null-pointer dereference in the GPIO character device code
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmLIQ2YACgkQEacuoBRx
 13KmMRAAqP0dMz9xocZWIif2feUYy4EAHGidIh0AN2ehTW0urmb6e8KAzOL4t0h6
 O7ODeCHXvtM7xGqmeFPveyY+yygSfB1oitQQWawePpUHtG0jHicG6gtV70S7k0BA
 MZbBhWHmJ0iC0s3x5DPnXlJ2/jqBjaF7UZi4bHVMMMfjB049YVTKQJ3mS/KTEFv8
 Wn5GBwSACwSlYYA9opjJNK7fxxU4z7tbiycORLFKoiG66AdOGz7aZeI9Rr06EZ3T
 ftkawIfxOtBivvcRdQmqKF3pvYju/aWnSTfCErmuifHP+sSsna8EZke+qvyx2YJp
 +Q95QObc/7sghKWjSNz1vvGRdT27kzyJdquopzVDdV5+vM6X7OGS/leSmGTo5m0f
 WAt8ZCmyGcTAsK3eL814vhntYls9aTiCeHLYD3i5k+cVym8qHxzGLe8vls8+Mmvy
 U/S0obfFHbe2dur4ET2f71vjF4niEJmDwNYTe5tCzTNP/9fWcw8LLMOKfdjLldu7
 44ennv+FAKE9eLRrRjQ8CkpXxUl++IV/TEtbTTY780ocSG4Olr951Ns7YQQC4aV3
 ro3SzmgBaeO7UDvelCUsxhQT1G3faBmhwaJh57CegGFSKQYN1waCmT/oispz4U0p
 08Xa7f2iNnWjBqI4nLWe2vad7+2Lq0SwH9jhp9oIw2qmVGGnz0I=
 =Fq0O
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2022-07-08 12:39:52 -07:00
commit 2b93fe647c
2 changed files with 5 additions and 3 deletions

View File

@ -19,6 +19,7 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/pinctrl/consumer.h>
#define VF610_GPIO_PER_PORT 32

View File

@ -1460,11 +1460,12 @@ static ssize_t linereq_read(struct file *file,
static void linereq_free(struct linereq *lr)
{
unsigned int i;
bool hte;
bool hte = false;
for (i = 0; i < lr->num_lines; i++) {
hte = !!test_bit(FLAG_EVENT_CLOCK_HTE,
&lr->lines[i].desc->flags);
if (lr->lines[i].desc)
hte = !!test_bit(FLAG_EVENT_CLOCK_HTE,
&lr->lines[i].desc->flags);
edge_detector_stop(&lr->lines[i], hte);
if (lr->lines[i].desc)
gpiod_free(lr->lines[i].desc);