[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1505980393-20307-3-git-send-email-arvind.yadav.cs@gmail.com>
Date: Thu, 21 Sep 2017 13:23:12 +0530
From: Arvind Yadav <arvind.yadav.cs@...il.com>
To: mchehab@...nel.org, bp@...en8.de, tony.luck@...el.com
Cc: linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] EDAC: sb_edac: Handle return value of kasprintf
kasprintf() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
drivers/edac/sb_edac.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index dc05916..2b9e831 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -3286,6 +3286,10 @@ static int sbridge_register_mci(struct sbridge_dev *sbridge_dev, enum type type)
pvt->sbridge_dev->source_id, pvt->sbridge_dev->dom);
break;
}
+ if (!mci->ctl_name) {
+ rc = -ENOMEM;
+ goto fail0;
+ }
/* Get dimm basic config and the memory layout */
rc = get_dimm_config(mci);
--
1.9.1
Powered by blists - more mailing lists