[PATCH] mt76/mt7915: Fix unsigned compared against zero

John Wood john.wood at gmx.com
Sat Jun 26 07:30:10 PDT 2021

On Sat, Jun 12, 2021 at 04:35:05PM +0200, John Wood wrote:
> The mt7915_dpd_freq_idx() function can return a negative value but this
> value is assigned to an unsigned variable named idx. Then, the code
> tests if this variable is less than zero. This can never happen with an
> unsigned type.
> So, change the idx type to a signed one.
> Addresses-Coverity-ID: 1484753 ("Unsigned compared against 0")
> Fixes: 495184ac91bb8 ("mt76: mt7915: add support for applying pre-calibration data")

Has anyone had time to review this patch?. Any comment on this?

John Wood

More information about the Linux-mediatek mailing list