Skip to content

Commit 2e32b9a

Browse files
Artem Shimkoopsiff
authored andcommitted
serial: 8250_dw: handle reset control deassert error
commit daeb403 upstream. Check the return value of reset_control_deassert() in the probe function to prevent continuing probe when reset deassertion fails. Previously, reset_control_deassert() was called without checking its return value, which could lead to probe continuing even when the device reset wasn't properly deasserted. The fix checks the return value and returns an error with dev_err_probe() if reset deassertion fails, providing better error handling and diagnostics. Fixes: acbdad8 ("serial: 8250_dw: simplify optional reset handling") Cc: stable <stable@kernel.org> Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com> Link: https://patch.msgid.link/20251019095131.252848-1-a.shimko.dev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit f354f7510ff0efaa1735093625749fc788ec67d1) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 3a9ffa1 commit 2e32b9a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/tty/serial/8250/8250_dw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,9 @@ static int dw8250_probe(struct platform_device *pdev)
659659
if (IS_ERR(data->rst))
660660
return PTR_ERR(data->rst);
661661

662-
reset_control_deassert(data->rst);
662+
err = reset_control_deassert(data->rst);
663+
if (err)
664+
return dev_err_probe(dev, err, "failed to deassert resets\n");
663665

664666
err = devm_add_action_or_reset(dev, dw8250_reset_control_assert, data->rst);
665667
if (err)

0 commit comments

Comments
 (0)