[SCSI] megaraid/megaraid_mm.c: fix a NULL pointer dereference
authorAdrian Bunk <bunk@stusta.de>
Fri, 10 Mar 2006 22:24:55 +0000 (23:24 +0100)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Thu, 20 Apr 2006 00:32:00 +0000 (20:32 -0400)
This patch fixes a NULL pointer dereference spotted by the Coverity
checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/megaraid/megaraid_mm.c

index 8f3ce04..e8f534f 100644 (file)
@@ -898,10 +898,8 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp)
 
        adapter = kmalloc(sizeof(mraid_mmadp_t), GFP_KERNEL);
 
-       if (!adapter) {
-               rval = -ENOMEM;
-               goto memalloc_error;
-       }
+       if (!adapter)
+               return -ENOMEM;
 
        memset(adapter, 0, sizeof(mraid_mmadp_t));