]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipmi:ssif: Fix a memory leak when scanning for an adapter
authorCorey Minyard <minyard@acm.org>
Mon, 19 Jun 2023 16:43:33 +0000 (11:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:22:40 +0000 (12:22 +0200)
commit3ad53071fe8547eb8d8813971844cc43246008ee
treec6bd39a06b3a4df0e071d7fbb485cd9b886da9d1
parent7792869495b6ef740be5281a4e80c231d535532f
ipmi:ssif: Fix a memory leak when scanning for an adapter

[ Upstream commit b8d72e32e1453d37ee5c8a219f24e7eeadc471ef ]

The adapter scan ssif_info_find() sets info->adapter_name if the adapter
info came from SMBIOS, as it's not set in that case.  However, this
function can be called more than once, and it will leak the adapter name
if it had already been set.  So check for NULL before setting it.

Fixes: c4436c9149c5 ("ipmi_ssif: avoid registering duplicate ssif interface")
Signed-off-by: Corey Minyard <minyard@acm.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/ipmi/ipmi_ssif.c