forked from Minki/linux
edac_mc: check for allocation failure in edac_mc_alloc()
Add a check here for if kzalloc() failed. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
5156a5f4e0
commit
08a4a13690
@ -355,6 +355,8 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
|
||||
}
|
||||
|
||||
dimm = kzalloc(sizeof(**mci->dimms), GFP_KERNEL);
|
||||
if (!dimm)
|
||||
goto error;
|
||||
mci->dimms[off] = dimm;
|
||||
dimm->mci = mci;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user