[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 <bunk@stusta.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
parent
52824b6b5f
commit
5236467ae7
1 changed files with 2 additions and 4 deletions
|
@ -898,10 +898,8 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp)
|
||||||
|
|
||||||
adapter = kmalloc(sizeof(mraid_mmadp_t), GFP_KERNEL);
|
adapter = kmalloc(sizeof(mraid_mmadp_t), GFP_KERNEL);
|
||||||
|
|
||||||
if (!adapter) {
|
if (!adapter)
|
||||||
rval = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto memalloc_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(adapter, 0, sizeof(mraid_mmadp_t));
|
memset(adapter, 0, sizeof(mraid_mmadp_t));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue