Commit 69a14ecc authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by Xie XiuQi
Browse files

ipmi: kcs_bmc: handle devm_kasprintf() failure case



mainline inclusion
from mainline-5.0
commit 42c7c6ef
category: bugfix
bugzilla: 11934
CVE: NA

-------------------------------------------------

devm_kasprintf() may return NULL if internal allocation failed so this
assignment is not safe. Moved the error exit path and added the !NULL
which then allows the devres manager to take care of cleanup.

Signed-off-by: default avatarNicholas Mc Guire <hofrat@osadl.org>
Fixes: cd2315d4 ("ipmi: kcs_bmc: don't change device name")
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
Reviewed-by: default avatarHaiyue Wang <haiyue.wang@linux.intel.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarXuefeng <Wang&lt;wxf.wang@hisilicon.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 748b9973
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment