Skip to content

Commit

Permalink
[SCSI] megaraid/megaraid_mm.c: fix a NULL pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adrian Bunk authored and James Bottomley committed Apr 20, 2006
1 parent 52824b6 commit 5236467
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/scsi/megaraid/megaraid_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 5236467

Please sign in to comment.