diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 98c759dc0d5dbe1e882a16ebb1a6afea77991838..91ca4101c7890a595093fce644f0cda10ac5add3 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -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;