linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] staging: pi433: fix error return code in pi433_probe()
@ 2020-04-28 15:06 Wei Yongjun
  0 siblings, 0 replies; 2+ messages in thread
From: Wei Yongjun @ 2020-04-28 15:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Kirill Smelkov, Nishka Dasgupta,
	Arnd Bergmann, Jarkko Sakkinen
  Cc: Wei Yongjun, devel, linux-kernel, kernel-janitors

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>
---
 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 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;




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH -next] staging: pi433: fix error return code in pi433_probe()
@ 2018-07-11 13:15 Wei Yongjun
  0 siblings, 0 replies; 2+ messages in thread
From: Wei Yongjun @ 2018-07-11 13:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman, minhnpq16, viro, srishtishar, Valentin.Vidic,
	simon, linux
  Cc: Wei Yongjun, devel, linux-kernel, kernel-janitors

Fix to return a negative error code from the kthread_run() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 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 293602d..d4bfac1 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -1235,6 +1235,7 @@ static int pi433_probe(struct spi_device *spi)
 					     device->minor);
 	if (IS_ERR(device->tx_task_struct)) {
 		dev_dbg(device->dev, "start of send thread failed");
+		retval = PTR_ERR(device->tx_task_struct);
 		goto send_thread_failed;
 	}
 




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-28 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 15:06 [PATCH -next] staging: pi433: fix error return code in pi433_probe() Wei Yongjun
  -- strict thread matches above, loose matches on Subject: below --
2018-07-11 13:15 Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).