Commit e086f614 authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman

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: default avatarMichael Straube <straube.linux@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d4d6b086
...@@ -1254,7 +1254,7 @@ static int pi433_probe(struct spi_device *spi) ...@@ -1254,7 +1254,7 @@ static int pi433_probe(struct spi_device *spi)
retval = cdev_add(device->cdev, device->devt, 1); retval = cdev_add(device->cdev, device->devt, 1);
if (retval) { if (retval) {
dev_dbg(device->dev, "register of cdev failed"); dev_dbg(device->dev, "register of cdev failed");
goto cdev_failed; goto del_cdev;
} }
/* spi setup */ /* spi setup */
...@@ -1262,6 +1262,8 @@ static int pi433_probe(struct spi_device *spi) ...@@ -1262,6 +1262,8 @@ static int pi433_probe(struct spi_device *spi)
return 0; return 0;
del_cdev:
cdev_del(device->cdev);
cdev_failed: cdev_failed:
kthread_stop(device->tx_task_struct); kthread_stop(device->tx_task_struct);
send_thread_failed: send_thread_failed:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment