mirror of
https://github.com/torvalds/linux.git
synced 2026-12-03 20:06:35 +00:00
rio_add_net() calls device_register() and fails when device_register()
fails. Thus, put_device() should be used rather than kfree(). Add
"mport->net = NULL;" to avoid a use after free issue.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: e8de370188 ("rapidio: add mport char device driver")
Signed-off-by: Haoxiang Li <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Cc: Alexandre Bounine <[email protected]>
Cc: Matt Porter <[email protected]>
Cc: Yang Yingliang <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>