-
由 Yang Yingliang 提交于
This reverts commit 59ebbe40 ("spi: simplify devm_spi_register_controller"). If devm_add_action() fails in devm_add_action_or_reset(), devm_spi_unregister() will be called, it decreases the refcount of 'ctlr->dev' to 0, then it will cause uaf in the drivers that calling spi_put_controller() in error path. Fixes: 59ebbe40 ("spi: simplify devm_spi_register_controller") Signed-off-by: NYang Yingliang <yangyingliang@huawei.com> Reviewed-by: NConor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20220712135504.1055688-1-yangyingliang@huawei.comSigned-off-by: NMark Brown <broonie@kernel.org>
43cc5a0a