public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Drokin <green@linuxhacker.ru>
To: alan@redhat.com, linux-kernel@vger.kernel.org,
	eokerson@quicknet.net, torvalds@transmeta.com
Subject: Memleak in Internet PhoneJACK driver
Date: Thu, 13 Mar 2003 23:20:35 +0300	[thread overview]
Message-ID: <20030313202035.GA3292@linuxhacker.ru> (raw)

Hello!

   There is unfree memory on error return path in ixj_build_filter_cadence().
   Trivial patch that applies to both 2.4 and 2.5 is below.
   Found with help of smatch + enhanced ufree patch.

Bye,
    Oleg

===== drivers/telephony/ixj.c 1.16 vs edited =====
--- 1.16/drivers/telephony/ixj.c	Fri Aug 23 04:23:39 2002
+++ edited/drivers/telephony/ixj.c	Thu Mar 13 23:15:51 2003
@@ -6001,12 +6001,14 @@
 		if(ixjdebug & 0x0001) {
 			printk(KERN_INFO "Could not copy cadence to kernel\n");
 		}
+		kfree(lcp);
 		return -EFAULT;
 	}
 	if (lcp->filter > 5) {
 		if(ixjdebug & 0x0001) {
 			printk(KERN_INFO "Cadence out of range\n");
 		}
+		kfree(lcp);
 		return -1;
 	}
 	j->cadence_f[lcp->filter].state = 0;

                 reply	other threads:[~2003-03-13 20:10 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=20030313202035.GA3292@linuxhacker.ru \
    --to=green@linuxhacker.ru \
    --cc=alan@redhat.com \
    --cc=eokerson@quicknet.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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