From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: "David S. Miller" <davem@davemloft.net>,
Arnd Bergmann <arnd@arndb.de>,
Wang Jian <jianjian.wang1@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>
Subject: [PATCH] pktgen: Fix memory leak in pktgen_if_write
Date: Wed, 14 Mar 2018 03:07:27 -0500 [thread overview]
Message-ID: <20180314080727.GA17319@embeddedgus> (raw)
_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 <jianjian.wang1@gmail.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
net/core/pktgen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index fd65761..545cf08 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")) {
--
2.7.4
next reply other threads:[~2018-03-14 8:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 8:07 Gustavo A. R. Silva [this message]
2018-03-14 8:40 ` [PATCH] pktgen: Fix memory leak in pktgen_if_write Arnd Bergmann
2018-03-14 14:02 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180314080727.GA17319@embeddedgus \
--to=gustavo@embeddedor.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=jianjian.wang1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox