diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-05-18 08:51:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-06-11 12:23:51 -0400 |
commit | 08a4a136909602eae0e71e147153461df077a46f (patch) | |
tree | ba8ec894512dd769b3cac5bcd4cfc4e4362124f5 /drivers | |
parent | 5156a5f4e058b906c1e8c0fe2ab16f30b60dee96 (diff) |
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')
-rw-r--r-- | drivers/edac/edac_mc.c | 2 |
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, | |||
355 | } | 355 | } |
356 | 356 | ||
357 | dimm = kzalloc(sizeof(**mci->dimms), GFP_KERNEL); | 357 | dimm = kzalloc(sizeof(**mci->dimms), GFP_KERNEL); |
358 | if (!dimm) | ||
359 | goto error; | ||
358 | mci->dimms[off] = dimm; | 360 | mci->dimms[off] = dimm; |
359 | dimm->mci = mci; | 361 | dimm->mci = mci; |
360 | 362 | ||