diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-05-18 14:51:02 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-06-11 18:23:51 +0200 |
commit | 08a4a136909602eae0e71e147153461df077a46f (patch) | |
tree | ba8ec894512dd769b3cac5bcd4cfc4e4362124f5 /drivers/edac | |
parent | edac: Increase version to 3.0.0 (diff) | |
download | linux-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.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; |