Skip to content

Commit be91c19

Browse files
author
Bartosz Golaszewski
committed
gpio: sysfs: fix inverted pointer logic
The logic is inverted, we want to return if the chip *IS* NULL. Fixes: d83cee3 ("gpio: protect the pointer to gpio_chip in gpio_device with SRCU") Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/linux-gpio/[email protected]/ Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 0d7fa0e commit be91c19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpiolib-sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ void gpiochip_sysfs_unregister(struct gpio_device *gdev)
802802
guard(srcu)(&gdev->srcu);
803803

804804
chip = srcu_dereference(gdev->chip, &gdev->srcu);
805-
if (chip)
805+
if (!chip)
806806
return;
807807

808808
/* unregister gpiod class devices owned by sysfs */

0 commit comments

Comments
 (0)