Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08a4a136 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab
Browse files

edac_mc: check for allocation failure in edac_mc_alloc()



Add a check here for if kzalloc() failed.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5156a5f4
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -355,6 +355,8 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
		}
		}


		dimm = kzalloc(sizeof(**mci->dimms), GFP_KERNEL);
		dimm = kzalloc(sizeof(**mci->dimms), GFP_KERNEL);
		if (!dimm)
			goto error;
		mci->dimms[off] = dimm;
		mci->dimms[off] = dimm;
		dimm->mci = mci;
		dimm->mci = mci;