Skip to content
Commit 8b2cdc00 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Greg Kroah-Hartman
Browse files

net/smc: remove device from smcd_dev_list after failed device_add()

[ Upstream commit 444d7be9 ]

If the device_add() for a smcd_dev fails, there's no cleanup step that
rolls back the earlier list_add(). The device subsequently gets freed,
and we end up with a corrupted list.

Add some error handling that removes the device from the list.

Fixes: c6ba7c9b

 ("net/smc: add base infrastructure for SMC-D and ISM")
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent beb39adb
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment