[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1350921364-26366-1-git-send-email-kirjanov@gmail.com>
Date: Mon, 22 Oct 2012 19:56:04 +0400
From: Denis Kirjanov <kirjanov@...il.com>
To: dougthompson@...ssion.com
CC: linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
Denis Kirjanov <kirjanov@...il.com>
Subject: [PATCH] check the kzalloc return value
Signed-off-by: Denis Kirjanov <kirjanov@...il.com>
---
drivers/edac/edac_mc_sysfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index ed0bc07..55ce016 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -1128,7 +1128,8 @@ int __init edac_mc_sysfs_init(void)
}
mci_pdev = kzalloc(sizeof(*mci_pdev), GFP_KERNEL);
-
+ if (!mci_pdev)
+ return -ENOMEM;
mci_pdev->bus = edac_subsys;
mci_pdev->type = &mc_attr_type;
device_initialize(mci_pdev);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists