]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arcnet: Add NULL check in com20020pci_probe()
authorHenry Martin <bsdhenrymartin@gmail.com>
Wed, 2 Apr 2025 13:50:36 +0000 (21:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:37:40 +0000 (14:37 +0200)
commitececf8eff6c25acc239fa8f0fd837c76bc770547
treefb9bd21725d3de30d0661612f42c3a5f3ba35bea
parentfa2f9fc35f56dd63eebd615ec9c78d727e5e494b
arcnet: Add NULL check in com20020pci_probe()

[ Upstream commit fda8c491db2a90ff3e6fbbae58e495b4ddddeca3 ]

devm_kasprintf() returns NULL when memory allocation fails. Currently,
com20020pci_probe() does not check for this case, which results in a
NULL pointer dereference.

Add NULL check after devm_kasprintf() to prevent this issue and ensure
no resources are left allocated.

Fixes: 6b17a597fc2f ("arcnet: restoring support for multiple Sohard Arcnet cards")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
Link: https://patch.msgid.link/20250402135036.44697-1-bsdhenrymartin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/arcnet/com20020-pci.c