mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
wimax: i2400: Fix memory leak in i2400m_op_rfkill_sw_toggle
[ Upstream commit6f3ef5c25c] In the implementation of i2400m_op_rfkill_sw_toggle() the allocated buffer for cmd should be released before returning. The documentation for i2400m_msg_to_dev() says when it returns the buffer can be reused. Meaning cmd should be released in either case. Move kfree(cmd) before return to be reached by all execution paths. Fixes:2507e6ab7a("wimax: i2400: fix memory leak") Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a3f674ed43
commit
cb89b0ed2a
@@ -127,12 +127,12 @@ int i2400m_op_rfkill_sw_toggle(struct wimax_dev *wimax_dev,
|
|||||||
"%d\n", result);
|
"%d\n", result);
|
||||||
result = 0;
|
result = 0;
|
||||||
error_cmd:
|
error_cmd:
|
||||||
kfree(cmd);
|
|
||||||
kfree_skb(ack_skb);
|
kfree_skb(ack_skb);
|
||||||
error_msg_to_dev:
|
error_msg_to_dev:
|
||||||
error_alloc:
|
error_alloc:
|
||||||
d_fnend(4, dev, "(wimax_dev %p state %d) = %d\n",
|
d_fnend(4, dev, "(wimax_dev %p state %d) = %d\n",
|
||||||
wimax_dev, state, result);
|
wimax_dev, state, result);
|
||||||
|
kfree(cmd);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user