Re: [PATCH] phy: fix compiler array bounds warning on settings[]
From: David Miller
Date: Thu Mar 06 2014 - 16:08:07 EST
From: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Date: Tue, 04 Mar 2014 17:35:44 -0700
> With -Werror=array-bounds, gcc v4.7.x warns that in phy_find_valid(), the
> settings[] "array subscript is above array bounds", I think because idx is
> a signed integer and if the caller supplied idx < 0, we pass the guard but
> still reference out of bounds.
>
> Fix this by making idx unsigned here and elsewhere.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/