提交 29d1df72 编写于 作者: G Gustavo A. R. Silva 提交者: 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: NWang Jian <jianjian.wang1@gmail.com>
Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册