diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-02-12 07:38:33 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-13 00:03:56 +0100 |
commit | 657d32efe04197736ed328a34ba659b5172c8cce (patch) | |
tree | 31acb29706b1af7a2bca1b18c39a73bbf57f03c4 /drivers/spi/spi.c | |
parent | spi: core: add spi_split_transfers_maxsize (diff) | |
download | linux-657d32efe04197736ed328a34ba659b5172c8cce.tar.xz linux-657d32efe04197736ed328a34ba659b5172c8cce.zip |
spi: checking for NULL instead of IS_ERR
spi_replace_transfers() returns error pointers on error, it never
returns NULL.
Fixes: d9f121227281 ('spi: core: add spi_split_transfers_maxsize')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r-- | drivers/spi/spi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 34e3741504f9..801e8900898b 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2262,8 +2262,8 @@ int __spi_split_transfer_maxsize(struct spi_master *master, /* create replacement */ srt = spi_replace_transfers(msg, xfer, 1, count, NULL, 0, gfp); - if (!srt) - return -ENOMEM; + if (IS_ERR(srt)) + return PTR_ERR(srt); xfers = srt->inserted_transfers; /* now handle each of those newly inserted spi_transfers |