Re: [PATCH] rndis_wlan: tighten check of rndis_query_oid return
From: Kalle Valo
Date: Tue Aug 18 2020 - 08:53:30 EST
trix@xxxxxxxxxx wrote:
> From: Tom Rix <trix@xxxxxxxxxx>
>
> clang static analysis reports this problem
>
> rndis_wlan.c:3147:25: warning: Assigned value is garbage or undefined
> wiphy->max_num_pmkids = le32_to_cpu(caps.num_pmkids);
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> The setting of caps happens here, with a call to rndis_query_oid()
>
> retval = rndis_query_oid(usbdev,
> if (retval >= 0) {
>
> Reviewing rndis_query_oid() shows that on success 0 is returned,
> failure is otherwise. So the retval check is not tight enough.
> So tighten the retval check. Similar problem in
> rndis_wlan_get_caps().
>
> Signed-off-by: Tom Rix <trix@xxxxxxxxxx>
Patch applied to wireless-drivers-next.git, thanks.
094dd0d73062 rndis_wlan: tighten check of rndis_query_oid return
--
https://patchwork.kernel.org/patch/11709263/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches