]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipmi:ssif: Add check for kstrdup
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Mon, 19 Jun 2023 09:28:02 +0000 (17:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:22:40 +0000 (12:22 +0200)
commit7792869495b6ef740be5281a4e80c231d535532f
tree13916d56b5f52c7d94623f2510b5d2903abd0af2
parent53abafedfeb7e059323e4ada8237ed408d6b76a3
ipmi:ssif: Add check for kstrdup

[ Upstream commit c5586d0f711e9744d0cade39b0c4a2d116a333ca ]

Add check for the return value of kstrdup() and return the error
if it fails in order to avoid NULL pointer dereference.

Fixes: c4436c9149c5 ("ipmi_ssif: avoid registering duplicate ssif interface")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Message-Id: <20230619092802.35384-1-jiasheng@iscas.ac.cn>
Signed-off-by: Corey Minyard <minyard@acm.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/ipmi/ipmi_ssif.c