public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Cc: "Petri T. Koistinen" <petri.koistinen@iki.fi>,
	linux-kernel@vger.kernel.org, vojtech@suse.cz,
	linux-input@atrey.karlin.mff.cuni.cz
Subject: [2.6 patch] fm801_gp_probe: fix use after free
Date: Sun, 12 Dec 2004 20:45:55 +0100	[thread overview]
Message-ID: <20041212194555.GE22324@stusta.de> (raw)

The patch below by "Petri T. Koistinen" <petri.koistinen@iki.fi> in 
Rusty's trivial patches is IMHO a candidate for 2.6.10 .


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.10-rc3/drivers/input/gameport/fm801-gp.c	2004-10-19 14:34:00.000000000 +1000
+++ .27568.trivial/drivers/input/gameport/fm801-gp.c	2004-12-05 11:06:01.000000000 +1100
@@ -98,8 +98,8 @@ static int __devinit fm801_gp_probe(stru
 	pci_enable_device(pci);
 	gp->gameport.io = pci_resource_start(pci, 0);
 	if ((gp->res_port = request_region(gp->gameport.io, 0x10, "FM801 GP")) == NULL) {
-		kfree(gp);
 		printk("unable to grab region 0x%x-0x%x\n", gp->gameport.io, gp->gameport.io + 0x0f);
+		kfree(gp);
 		return -1;
 	}
 


                 reply	other threads:[~2004-12-12 19:46 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=20041212194555.GE22324@stusta.de \
    --to=bunk@stusta.de \
    --cc=akpm@osdl.org \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petri.koistinen@iki.fi \
    --cc=torvalds@osdl.org \
    --cc=vojtech@suse.cz \
    /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