]> www.infradead.org Git - nvme.git/commit
wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer()
authorZhipeng Lu <alexious@zju.edu.cn>
Fri, 26 Jan 2024 07:53:34 +0000 (15:53 +0800)
committerKalle Valo <kvalo@kernel.org>
Mon, 5 Feb 2024 18:15:27 +0000 (20:15 +0200)
commit5f0e4aede01cb01fa633171f0533affd25328c3a
tree9b27d3f1ccf28b34d0dbb19d71d807095ae69e9e
parent679dd27b4ef33d4f596cbf450a3b2742fc54962a
wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer()

In the for statement of lbs_allocate_cmd_buffer(), if the allocation of
cmdarray[i].cmdbuf fails, both cmdarray and cmdarray[i].cmdbuf needs to
be freed. Otherwise, there will be memleaks in lbs_allocate_cmd_buffer().

Fixes: 876c9d3aeb98 ("[PATCH] Marvell Libertas 8388 802.11b/g USB driver")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240126075336.2825608-1-alexious@zju.edu.cn
drivers/net/wireless/marvell/libertas/cmd.c