Re: [PATCH] soc: qcom: pmic_glink_altmode: fix port sanity check

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

 



On Thu, Nov 09, 2023 at 02:28:59PM +0100, Konrad Dybcio wrote:
> On 11/9/23 10:31, Johan Hovold wrote:
  
> > -	if (!altmode->ports[port].altmode) {
> > +	if (port >= ARRAY_SIZE(altmode->ports) || !altmode->ports[port].altmode) {

> I'd personally use PMIC_GLINK_MAX_PORTS directly but it's the same

That's what I'd generally do as well, but here I followed the style of
this driver (and using ARRAY_SIZE() is arguable more safe).

> Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>

Thanks for reviewing.

Johan




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux