* [patch] edac_mc: check for allocation failure in edac_mc_alloc()
@ 2012-05-18 12:51 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-05-18 12:51 UTC (permalink / raw)
To: kernel-janitors
Add a check here for if kzalloc() failed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index f9c75f9..138c545 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -352,6 +352,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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-05-18 12:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-18 12:51 [patch] edac_mc: check for allocation failure in edac_mc_alloc() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox