Re: [PATCH] wimax: i2400: Fix memory leak in i2400m_op_rfkill_sw_toggle

From: David Miller
Date: Tue Oct 29 2019 - 19:20:57 EST


From: Navid Emamdoost <navid.emamdoost@xxxxxxxxx>
Date: Fri, 25 Oct 2019 23:53:30 -0500

> 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: 2507e6ab7a9a ("wimax: i2400: fix memory leak")
> Signed-off-by: Navid Emamdoost <navid.emamdoost@xxxxxxxxx>

Applied.