Re: [wireless-next] qtnfmac: check band before allocating cmd_skb to avoid resource leak
From: Kalle Valo
Date: Tue Jun 13 2017 - 03:02:20 EST
Colin Ian King <colin.king@xxxxxxxxxxxxx> wrote:
> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> The current code allocates cmd_skb and then will leak this if band->band
> is an illegal value. It is simpler to sanity check the band first before
> allocating cmd_skb so that we don't have to free cmd_skb if an invalid
> band occurs.
>
> Detected by CoverityScan, CID#1437561 ("Resource Leak")
>
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
> Reviewed-by: Igor Mitsyanko <igor.mitsyanko.os@xxxxxxxxxxxxx>
Patch applied to wireless-drivers-next.git, thanks.
bc0384eedb66 qtnfmac: check band before allocating cmd_skb to avoid resource leak
--
https://patchwork.kernel.org/patch/9762863/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches