From: Oleg Drokin <green@linuxhacker.ru>
To: linux-kernel@vger.kernel.org, alan@redhat.com
Subject: [2.4] memleak in implementation of the IEEE 802.2 LLC protocol?
Date: Sun, 15 Jun 2003 13:26:56 +0400 [thread overview]
Message-ID: <20030615092656.GA23595@linuxhacker.ru> (raw)
Hello!
I am trying to teach smatch's unfree script of skbuffers as those could
create memory leaks if not freed, and I come across this code in
./net/802/llc_sendpdu.c::llc_sendipdu() in 2.4.21 kernel:
tmp=skb_clone(skb, GFP_ATOMIC);
if(tmp!=NULL)
{
tmp->dev = lp->dev;
dev_queue_xmit(skb);
}
(and tmp is not used anywhere else)
Naturally looking at llc_sendipdu() function that have similar construction,
I think that this small change should be done to avoid memleak
and to make the code correct, what do you think?
===== net/802/llc_sendpdu.c 1.3 vs edited =====
--- 1.3/net/802/llc_sendpdu.c Tue Feb 5 10:39:14 2002
+++ edited/net/802/llc_sendpdu.c Sun Jun 15 13:23:39 2003
@@ -283,7 +283,7 @@
if(tmp!=NULL)
{
tmp->dev = lp->dev;
- dev_queue_xmit(skb);
+ dev_queue_xmit(tmp);
}
resend_count++;
skb = skb->next;
Bye,
Oleg
reply other threads:[~2003-06-15 9:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030615092656.GA23595@linuxhacker.ru \
--to=green@linuxhacker.ru \
--cc=alan@redhat.com \
--cc=linux-kernel@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