diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-05-18 15:51:02 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-06-11 13:23:51 -0300 |
commit | 08a4a136909602eae0e71e147153461df077a46f (patch) | |
tree | ba8ec894512dd769b3cac5bcd4cfc4e4362124f5 /drivers/edac | |
parent | 5156a5f4e058b906c1e8c0fe2ab16f30b60dee96 (diff) | |
download | linux-08a4a136909602eae0e71e147153461df077a46f.tar.bz2 |
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.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, } dimm = kzalloc(sizeof(**mci->dimms), GFP_KERNEL); + if (!dimm) + goto error; mci->dimms[off] = dimm; dimm->mci = mci; |