diff options
author | Gustavo A. R. Silva <[email protected]> | 2018-03-14 03:07:27 -0500 |
---|---|---|
committer | David S. Miller <[email protected]> | 2018-03-14 10:02:15 -0400 |
commit | 29d1df72ce2ac187d457990fe445a16212dcfa19 (patch) | |
tree | 099306c5dd9e6a77ddc750bcd37d1913ca9fe9a3 | |
parent | a870a02cc963de35452bbed932560ed69725c4f2 (diff) |
pktgen: Fix memory leak in pktgen_if_write
_buf_ is an array and the one that must be freed is _tp_ instead.
Fixes: a870a02cc963 ("pktgen: use dynamic allocation for debug print buffer")
Reported-by: Wang Jian <[email protected]>
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
-rw-r--r-- | net/core/pktgen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index fd65761e1fed..545cf08cd558 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -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")) { |