diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2020-04-28 15:06:50 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-05 12:31:18 +0200 |
commit | 70458c20049f16a5512bf89ac5137f79d3049f91 (patch) | |
tree | ce2c7e840f96327e88f6ed956a29d80db4e477f4 /drivers/staging | |
parent | 16529e3b8655b9b8bff776ecc4036f07711658a4 (diff) |
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/pi433/pi433_if.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 313d22f6210f..c8d0c63fdd1d 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; |