* Re: linux-4.9-rc1/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c:1561: poor error checking ?
[not found] ` <VI1PR08MB1022786893DC435E1A71F3069CD00-Rgw4eRhbCXnvbuUDGEufgykoKrxaZxrJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2016-10-17 7:58 ` Luca Coelho
0 siblings, 0 replies; only message in thread
From: Luca Coelho @ 2016-10-17 7:58 UTC (permalink / raw)
To: David Binderman,
johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
emmanuel.grumbach-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
linuxwifi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Hi David,
On Mon, 2016-10-17 at 07:40 +0000, David Binderman wrote:
> Hello there,
>
> linux-4.9-rc1/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c:1561]: (style) Checking if unsigned variable 'len' is less than zero.
>
> Source code is
>
> len = min((size_t)le32_to_cpu(rsp->len) << 2,
> iwl_rx_packet_payload_len(hcmd.resp_pkt) - sizeof(*rsp));
> len = min(len - delta, count);
> if (len < 0) {
> ret = -EFAULT;
> goto out;
> }
>
> Suggest improve error checking.
Thanks for reporting! A fix for this is already queued in our internal
tree and will be sent upstream soon.
--
Cheers,
Luca.
^ permalink raw reply [flat|nested] only message in thread