mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 18:09:57 +00:00
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
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue