diff mbox

spi: core: Do not mangle error code from kthread_run()

Message ID 1417683745-26349-1-git-send-email-jarkko.nikula@linux.intel.com (mailing list archive)
State Accepted
Commit 98a8f5a0538fe1a02a6a73a3451f1c093e30bdfc
Headers show

Commit Message

Jarkko Nikula Dec. 4, 2014, 9:02 a.m. UTC
kthread_run() could return ERR_PTR(-EINTR) from kthread_create_on_node().
Return the actual error code in spi_init_queue() instead of mangling it to
-ENOMEM.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Dec. 4, 2014, 10:42 p.m. UTC | #1
On Thu, Dec 04, 2014 at 11:02:25AM +0200, Jarkko Nikula wrote:
> kthread_run() could return ERR_PTR(-EINTR) from kthread_create_on_node().
> Return the actual error code in spi_init_queue() instead of mangling it to
> -ENOMEM.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 50f20f243981..da7e6225b8f6 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1001,7 +1001,7 @@  static int spi_init_queue(struct spi_master *master)
 					   dev_name(&master->dev));
 	if (IS_ERR(master->kworker_task)) {
 		dev_err(&master->dev, "failed to create message pump task\n");
-		return -ENOMEM;
+		return PTR_ERR(master->kworker_task);
 	}
 	init_kthread_work(&master->pump_messages, spi_pump_messages);