summaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-05-18 14:51:02 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-06-11 18:23:51 +0200
commit08a4a136909602eae0e71e147153461df077a46f (patch)
treeba8ec894512dd769b3cac5bcd4cfc4e4362124f5 /drivers/edac
parentedac: Increase version to 3.0.0 (diff)
downloadlinux-08a4a136909602eae0e71e147153461df077a46f.tar.xz
linux-08a4a136909602eae0e71e147153461df077a46f.zip
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')
-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;