[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75VdsRgV8vrTiZmJwL-fhms7NRT27cBbr9WCBFORqvthVjw@mail.gmail.com>
Date: Tue, 20 Apr 2021 17:33:12 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Mark Brown <broonie@...nel.org>,
linux-spi <linux-spi@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 1/1] spi: Don't overwrite num_chipselect with error code
On Tue, Apr 20, 2021 at 4:19 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> The code currently organized in a way that num_chipselect is overwritten
> each time we call spi_get_gpio_descs(). It might be potentially dangerous
> in case when the gpiod_count() returns an error code.
>
> Note, that gpiod_count() never returns 0, take this into account as well.
>
> Fixes: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
It doesn't fix anything. I missed the max_t(int).
In any case it makes error handling cleaner, so I'll reformulate the
commit message in v2 and drop Fixes tag.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists