Skip to content

Commit c775ea4

Browse files
Tzung-Bi Shihgregkh
authored andcommitted
gpio: cdev: Correct return code on memory allocation failure
commit faff684 upstream. -ENOMEM is a more appropriate return code for memory allocation failures. Correct it. Cc: stable@vger.kernel.org Fixes: 20bddcb ("gpiolib: cdev: replace locking wrappers for gpio_device with guards") Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20260116081036.352286-6-tzungbi@kernel.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f72b579 commit c775ea4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpio/gpiolib-cdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2767,7 +2767,7 @@ static int gpio_chrdev_open(struct inode *inode, struct file *file)
27672767

27682768
cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
27692769
if (!cdev)
2770-
return -ENODEV;
2770+
return -ENOMEM;
27712771

27722772
cdev->watched_lines = bitmap_zalloc(gdev->ngpio, GFP_KERNEL);
27732773
if (!cdev->watched_lines)

0 commit comments

Comments
 (0)