The lone caller of initChainBuffers checks the return code for < 0, so
it is safe to appease smatch and return the proper errno value.

Fixes the following smatch warnings:

  drivers/message/fusion/mptbase.c:4328 initChainBuffers() warn:
    returning -1 instead of -ENOMEM is sloppy

  drivers/message/fusion/mptbase.c:4335 initChainBuffers() warn:
    returning -1 instead of -ENOMEM is sloppy

  drivers/message/fusion/mptbase.c:4402 initChainBuffers() warn:
    returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Joe Lawrence <joe.lawre...@stratus.com>
Cc: Christoph Hellwig <h...@infradead.org>
Cc: Dan Carpenter <dan.carpen...@oracle.com>
Cc: Sreekanth Reddy <sreekanth.re...@lsi.com>
---
 drivers/message/fusion/mptbase.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 5ef3f89..a70b873 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -4325,14 +4325,14 @@ initChainBuffers(MPT_ADAPTER *ioc)
                sz = ioc->req_depth * sizeof(int);
                mem = kmalloc(sz, GFP_ATOMIC);
                if (mem == NULL)
-                       return -1;
+                       return -ENOMEM;
 
                ioc->ReqToChain = (int *) mem;
                dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ReqToChain alloc  @ 
%p, sz=%d bytes\n",
                                ioc->name, mem, sz));
                mem = kmalloc(sz, GFP_ATOMIC);
                if (mem == NULL)
-                       return -1;
+                       return -ENOMEM;
 
                ioc->RequestNB = (int *) mem;
                dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "RequestNB alloc  @ 
%p, sz=%d bytes\n",
@@ -4399,7 +4399,7 @@ initChainBuffers(MPT_ADAPTER *ioc)
        if (ioc->ChainToChain == NULL) {
                mem = kmalloc(sz, GFP_ATOMIC);
                if (mem == NULL)
-                       return -1;
+                       return -ENOMEM;
 
                ioc->ChainToChain = (int *) mem;
                dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ChainToChain alloc @ 
%p, sz=%d bytes\n",
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to