From 70458c20049f16a5512bf89ac5137f79d3049f91 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Tue, 28 Apr 2020 15:06:50 +0000 Subject: [PATCH] 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 Link: https://lore.kernel.org/r/20200428150650.102340-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/pi433/pi433_if.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 313d22f6210f3..c8d0c63fdd1d7 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -1230,6 +1230,7 @@ static int pi433_probe(struct spi_device *spi) device->cdev = cdev_alloc(); if (!device->cdev) { dev_dbg(device->dev, "allocation of cdev failed"); + retval = -ENOMEM; goto cdev_failed; } device->cdev->owner = THIS_MODULE; -- 2.30.2