diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-05-18 15:51:02 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-28 19:14:08 -0300 |
commit | 2e6c50e0b70d59bf3edd1890018df757bf8dd1a6 (patch) | |
tree | bbcc05ce8cab9153980a84b9136ec9c5cfaa06cb | |
parent | 4368faccfdeb47480567e1db6d2afc055eda045c (diff) | |
download | linux-edac-2e6c50e0b70d59bf3edd1890018df757bf8dd1a6.tar.gz |
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>
-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 10a39b522ac8b9..efcda7fd4a6c3e 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -354,6 +354,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; |