diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-09-21 12:16:56 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2017-09-21 12:18:44 +0200 |
commit | 75f029c3a83f3e7a1d0d928efa4fe47dd6a8a9eb (patch) | |
tree | eb03274258a15fc3c08963a1b6cdb8b24c4811ef /drivers/edac/sb_edac.c | |
parent | Linux 4.14-rc1 (diff) | |
download | linux-75f029c3a83f3e7a1d0d928efa4fe47dd6a8a9eb.tar.xz linux-75f029c3a83f3e7a1d0d928efa4fe47dd6a8a9eb.zip |
EDAC: Handle return value of kasprintf()
kasprintf() can fail and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: linux-edac@vger.kernel.org
[ Merged into a single patch, small formatting fixups. ]
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/edac/sb_edac.c')
-rw-r--r-- | drivers/edac/sb_edac.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index dc0591654011..2078ee414568 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c @@ -3287,6 +3287,11 @@ static int sbridge_register_mci(struct sbridge_dev *sbridge_dev, enum type type) break; } + if (!mci->ctl_name) { + rc = -ENOMEM; + goto fail0; + } + /* Get dimm basic config and the memory layout */ rc = get_dimm_config(mci); if (rc < 0) { |