summaryrefslogtreecommitdiff
path: root/drivers/staging/pi433
diff options
context:
space:
mode:
authorMichael Straube <straube.linux@gmail.com>2018-11-26 19:18:20 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-05 09:39:45 +0100
commite086f61479d1ae4dd78fd882228311ce31e73e91 (patch)
treeb6c8bdea6b8d0d86045f5ae288e16ca8dd9eb460 /drivers/staging/pi433
parentd4d6b086df62b37e5712d006bc87bc56efbbae67 (diff)
staging: pi433: add missing call to cdev_del()
If cdev_add() fails, cdev_del() should be called. Add the missing cdev_del() call as pointed out by Dan Carpenter. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/pi433')
-rw-r--r--drivers/staging/pi433/pi433_if.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index d72de2105053..b2314636dc89 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -1254,7 +1254,7 @@ static int pi433_probe(struct spi_device *spi)
retval = cdev_add(device->cdev, device->devt, 1);
if (retval) {
dev_dbg(device->dev, "register of cdev failed");
- goto cdev_failed;
+ goto del_cdev;
}
/* spi setup */
@@ -1262,6 +1262,8 @@ static int pi433_probe(struct spi_device *spi)
return 0;
+del_cdev:
+ cdev_del(device->cdev);
cdev_failed:
kthread_stop(device->tx_task_struct);
send_thread_failed: