mwifiex: Fix mem leak in mwifiex_tm_cmd
authorYueHaibing <yuehaibing@huawei.com>
Tue, 12 Mar 2019 07:03:58 +0000 (15:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:47:29 +0000 (06:47 -0700)
commitccebaeca5089c49f2b331e91334b2d2e7a40e53c
treea3e230a7fd55a4e45be6005547a70ffc1df927df
parent4a63186e40e4c9bdd3afde281e57d162f39762d7
mwifiex: Fix mem leak in mwifiex_tm_cmd

[ Upstream commit 003b686ace820ce2d635a83f10f2d7f9c147dabc ]

'hostcmd' is alloced by kzalloc, should be freed before
leaving from the error handling cases, otherwise it will
cause mem leak.

Fixes: 3935ccc14d2c ("mwifiex: add cfg80211 testmode support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/marvell/mwifiex/cfg80211.c