Skip to content

Commit 29d1df7

Browse files
GustavoARSilvadavem330
authored andcommitted
pktgen: Fix memory leak in pktgen_if_write
_buf_ is an array and the one that must be freed is _tp_ instead. Fixes: a870a02 ("pktgen: use dynamic allocation for debug print buffer") Reported-by: Wang Jian <jianjian.wang1@gmail.com> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a870a02 commit 29d1df7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/pktgen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ static ssize_t pktgen_if_write(struct file *file,
913913
return PTR_ERR(tp);
914914

915915
pr_debug("%s,%zu buffer -:%s:-\n", name, count, tp);
916-
kfree(buf);
916+
kfree(tp);
917917
}
918918

919919
if (!strcmp(name, "min_pkt_size")) {

0 commit comments

Comments
 (0)