Re: [PATCH] spi: hi311x: Add check for hi3110_power_enable() return value
From: Marc Kleine-Budde
Date: Tue Mar 10 2026 - 06:16:51 EST
On 10.03.2026 13:08:44, Wenyuan Li wrote:
> Add a check for the return value and propagate the error accordingly.
>
> Signed-off-by: Wenyuan Li <2063309626@xxxxxx>
Applied with fixed subject/patch description...
> ---
> drivers/net/can/spi/hi311x.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c
> index e00d3dbc4cf4..f0444b4c5b6e 100644
> --- a/drivers/net/can/spi/hi311x.c
> +++ b/drivers/net/can/spi/hi311x.c
> @@ -755,8 +755,9 @@ static int hi3110_open(struct net_device *net)
> return ret;
>
> mutex_lock(&priv->hi3110_lock);
> - hi3110_power_enable(priv->transceiver, 1);
> -
> + ret = hi3110_power_enable(priv->transceiver, 1);
> + if (ret)
> + goto out_disable;
...and renamed jump label to out_close_candev
> priv->force_quit = 0;
> priv->tx_skb = NULL;
> priv->tx_busy = false;
> @@ -790,6 +791,7 @@ static int hi3110_open(struct net_device *net)
> hi3110_hw_sleep(spi);
> out_close:
> hi3110_power_enable(priv->transceiver, 0);
> + out_disable:
> close_candev(net);
> mutex_unlock(&priv->hi3110_lock);
> return ret;
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature