]> git.baikalelectronics.ru Git - kernel.git/commit
qtnfmac: check band before allocating cmd_skb to avoid resource leak
authorColin Ian King <colin.king@canonical.com>
Fri, 2 Jun 2017 15:40:45 +0000 (16:40 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 13 Jun 2017 07:01:36 +0000 (10:01 +0300)
commit55d3a6219df0795a75b71065bfc1fcb7e4a56fac
treee53f5ea99214ab22cbabe8cc6023428cd023f2da
parent85434288e589e7144b8a300eafc622601324d4f0
qtnfmac: check band before allocating cmd_skb to avoid resource leak

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@canonical.com>
Reviewed-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/commands.c