Skip to content

Commit

Permalink
ath6kl: fix memory leak in ath6kl_fwlog_block_read()
Browse files Browse the repository at this point in the history
If, in
drivers/net/wireless/ath/ath6kl/debug.c::ath6kl_fwlog_block_read(),
the call to wait_for_completion_interruptible() returns -ERESTARTSYS
then we'll return without freeing the (as yet unused) memory we
allocated for 'buf' - thus leaking it.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  • Loading branch information
Jesper Juhl authored and Kalle Valo committed Apr 13, 2012
1 parent 6146ca6 commit ae9a340
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/wireless/ath/ath6kl/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,10 @@ static ssize_t ath6kl_fwlog_block_read(struct file *file,

ret = wait_for_completion_interruptible(
&ar->debug.fwlog_completion);
if (ret == -ERESTARTSYS)
if (ret == -ERESTARTSYS) {
vfree(buf);
return ret;
}

spin_lock(&ar->debug.fwlog_queue.lock);
}
Expand Down

0 comments on commit ae9a340

Please sign in to comment.