From: Adrian Bunk Date: Fri, 10 Mar 2006 22:24:55 +0000 (+0100) Subject: [SCSI] megaraid/megaraid_mm.c: fix a NULL pointer dereference X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=5236467ae72ecd71baa162b7734c57bfe8fa0ff9;p=openwrt%2Fstaging%2Fblogic.git [SCSI] megaraid/megaraid_mm.c: fix a NULL pointer dereference This patch fixes a NULL pointer dereference spotted by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index 8f3ce0432295..e8f534fb336b 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c @@ -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));