lkml.org 
[lkml]   [2017]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] EDAC: sb_edac: Handle return value of kasprintf
Date
kasprintf() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.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
\
 
 \ /
  Last update: 2017-09-21 19:29    [W:0.062 / U:0.924 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site