ipmi: kcs_bmc: handle devm_kasprintf() failure case
authorNicholas Mc Guire <hofrat@osadl.org>
Wed, 21 Nov 2018 15:08:25 +0000 (16:08 +0100)
committerCorey Minyard <cminyard@mvista.com>
Sun, 10 Feb 2019 01:48:42 +0000 (19:48 -0600)
commit42c7c6ef1e6fa5fc0425120f06f045190b1dda2d
tree26010cb2ef893366597949cbfa3b24cc5e0afb1b
parent95ac0daa0ca98ad8ac23769021144f8bf04cf406
ipmi: kcs_bmc: handle devm_kasprintf() failure case

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: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: cd2315d471f4 ("ipmi: kcs_bmc: don't change device name")
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Haiyue Wang <haiyue.wang@linux.intel.com>
drivers/char/ipmi/kcs_bmc.c