Commit 29d1df72 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by David S. Miller

pktgen: Fix memory leak in pktgen_if_write

_buf_ is an array and the one that must be freed is _tp_ instead.

Fixes: a870a02c ("pktgen: use dynamic allocation for debug print buffer")
Reported-by: default avatarWang Jian <jianjian.wang1@gmail.com>
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a870a02c
......@@ -913,7 +913,7 @@ static ssize_t pktgen_if_write(struct file *file,
return PTR_ERR(tp);
pr_debug("%s,%zu buffer -:%s:-\n", name, count, tp);
kfree(buf);
kfree(tp);
}
if (!strcmp(name, "min_pkt_size")) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment