Skip to content

Commit d50a923

Browse files
Artem Shimkogregkh
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 <[email protected]> Signed-off-by: Artem Shimko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3466973 commit d50a923

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

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

623-
reset_control_deassert(data->rst);
623+
err = reset_control_deassert(data->rst);
624+
if (err)
625+
return dev_err_probe(dev, err, "failed to deassert resets\n");
624626

625627
err = devm_add_action_or_reset(dev, dw8250_reset_control_assert, data->rst);
626628
if (err)

0 commit comments

Comments
 (0)