summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorVaradarajan Narayanan <varada@codeaurora.org>2017-07-28 09:52:52 +0300
committerMark Brown <broonie@kernel.org>2017-08-08 14:15:18 +0300
commitd9a09a6c0c98d57e5a248c3b9bb10f63d475dfdb (patch)
treefc43db963afb873311f8fe15c9b4132504fe55bb /drivers/spi
parentce00bab3187f9fc1afac07914959bff0c52547c2 (diff)
downloadlinux-d9a09a6c0c98d57e5a248c3b9bb10f63d475dfdb.tar.xz
spi: qup: Fix error handling in spi_qup_prep_sg
Signed-off-by: Varadarajan Narayanan <varada@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-qup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index f1aa5c15d180..ef952946375a 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -311,8 +311,8 @@ static int spi_qup_prep_sg(struct spi_master *master, struct spi_transfer *xfer,
}
desc = dmaengine_prep_slave_sg(chan, sgl, nents, dir, flags);
- if (!desc)
- return -EINVAL;
+ if (IS_ERR_OR_NULL(desc))
+ return desc ? PTR_ERR(desc) : -EINVAL;
desc->callback = callback;
desc->callback_param = qup;