Re: [PATCH] spi: spi-mux: Fix coverity issue, unchecked return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sat, Mar 15, 2025 at 6:01 AM Sergio Perez Gonzalez
<sperezglz@xxxxxxxxx> wrote:
>
> The return value of spi_setup() is not captured within
> spi_mux_select() and it is assumed to be always success.
>
> CID: 1638374
>
> Signed-off-by: Sergio Perez Gonzalez <sperezglz@xxxxxxxxx>
> ---
>  drivers/spi/spi-mux.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/spi-mux.c b/drivers/spi/spi-mux.c
> index c02c4204442f..0f45a88bfbe7 100644
> --- a/drivers/spi/spi-mux.c
> +++ b/drivers/spi/spi-mux.c
> @@ -68,9 +68,9 @@ static int spi_mux_select(struct spi_device *spi)
>
>         priv->current_cs = spi_get_chipselect(spi, 0);
>
> -       spi_setup(priv->spi);
> +       ret = spi_setup(priv->spi);
>
> -       return 0;
> +       return ret;

Maybe just do

return spi_setup(priv->spi);

Best regards,
Jonas





[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux