Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: pi433: fix error return code in pi433_probe()

Fix to return negative error code -ENOMEM from cdev alloc failed error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200428150650.102340-1-weiyongjun1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Wei Yongjun and committed by
Greg Kroah-Hartman
70458c20 16529e3b

+1
+1
drivers/staging/pi433/pi433_if.c
··· 1230 1230 device->cdev = cdev_alloc(); 1231 1231 if (!device->cdev) { 1232 1232 dev_dbg(device->dev, "allocation of cdev failed"); 1233 + retval = -ENOMEM; 1233 1234 goto cdev_failed; 1234 1235 } 1235 1236 device->cdev->owner = THIS_MODULE;