spi: core: Do not mangle error code from kthread_run()
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Thu, 4 Dec 2014 09:02:25 +0000 (11:02 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 4 Dec 2014 22:42:37 +0000 (22:42 +0000)
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c

index ebcb33df2eb22facb58cebc10277c3ab12925a42..4395a5406e5ce905ebd18085252d5b2f35108e25 100644 (file)
@@ -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);