mirror of
https://github.com/torvalds/linux.git
synced 2026-01-24 23:16:46 +00:00
gpio: cdev: Correct return code on memory allocation failure
-ENOMEM is a more appropriate return code for memory allocation
failures. Correct it.
Cc: stable@vger.kernel.org
Fixes: 20bddcb40b ("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>
This commit is contained in:
committed by
Bartosz Golaszewski
parent
24d479d26b
commit
faff684647
@@ -2696,7 +2696,7 @@ static int gpio_chrdev_open(struct inode *inode, struct file *file)
|
||||
|
||||
cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
|
||||
if (!cdev)
|
||||
return -ENODEV;
|
||||
return -ENOMEM;
|
||||
|
||||
cdev->watched_lines = bitmap_zalloc(gdev->ngpio, GFP_KERNEL);
|
||||
if (!cdev->watched_lines)
|
||||
|
||||
Reference in New Issue
Block a user