summaryrefslogtreecommitdiff
path: root/drivers/edac/edac_mc.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-05-18 16:51:02 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-06-11 20:23:51 +0400
commit08a4a136909602eae0e71e147153461df077a46f (patch)
treeba8ec894512dd769b3cac5bcd4cfc4e4362124f5 /drivers/edac/edac_mc.c
parent5156a5f4e058b906c1e8c0fe2ab16f30b60dee96 (diff)
downloadlinux-08a4a136909602eae0e71e147153461df077a46f.tar.xz
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>
Diffstat (limited to 'drivers/edac/edac_mc.c')
-rw-r--r--drivers/edac/edac_mc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 98c759dc0d5d..91ca4101c789 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;