From: Gustavo A. R. Silva Date: Wed, 14 Mar 2018 08:07:27 +0000 (-0500) Subject: pktgen: Fix memory leak in pktgen_if_write X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=29d1df72ce2ac187d457990fe445a16212dcfa19;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Gustavo A. R. Silva Acked-by: Arnd Bergmann Signed-off-by: David S. Miller --- 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")) {