From 657d32efe04197736ed328a34ba659b5172c8cce Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 12 Feb 2016 09:38:33 +0300 Subject: [PATCH] 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 Signed-off-by: Mark Brown --- drivers/spi/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 34e3741..801e890 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 -- 2.7.4