Staging: ft1000-usb: Fix Smatch Warning in ft1000_hw.c
authorMonam Agarwal <monamagarwal123@gmail.com>
Sun, 9 Mar 2014 05:28:08 +0000 (10:58 +0530)
committerPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Mon, 17 Mar 2014 00:43:17 +0000 (17:43 -0700)
This patch fixes following smatch warning:
/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c:1148 ft1000_proc_drvmsg() warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c

index a433e33049b550e19cf83552c399bc1dd5a86121..b6a77088cfe4b290a654d5717b442c521caa0e80 100644 (file)
@@ -1145,7 +1145,7 @@ static int ft1000_proc_drvmsg(struct ft1000_usb *dev, u16 size)
 
        char *cmdbuffer = kmalloc(1600, GFP_KERNEL);
        if (!cmdbuffer)
-               return -1;
+               return -ENOMEM;
 
        status = ft1000_read_dpram32(dev, 0x200, cmdbuffer, size);