From: Jesper Juhl <jesper.juhl@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Vojtech Pavlik <vojtech@ucw.cz>, Andrew Morton <akpm@osdl.org>,
Jesper Juhl <jesper.juhl@gmail.com>
Subject: [PATCH] fix mem-leak in sidewinder driver
Date: Sun, 7 May 2006 04:03:47 +0200 [thread overview]
Message-ID: <200605070403.47763.jesper.juhl@gmail.com> (raw)
In sw_connect we leak 'buf' and 'idbuf' when we do not leave via one of
the fail* labels. This was spotted by the coverity checker.
This patch fixes the memory leak.
Patch is compile tested only due to lack of hardware.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
drivers/input/joystick/sidewinder.c | 2 ++
1 files changed, 2 insertions(+)
--- linux-2.6.17-rc3-git12-orig/drivers/input/joystick/sidewinder.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.17-rc3-git12/drivers/input/joystick/sidewinder.c 2006-05-07 03:57:47.000000000 +0200
@@ -776,6 +776,8 @@ static int sw_connect(struct gameport *g
goto fail4;
}
+ kfree(buf);
+ kfree(idbuf);
return 0;
fail4: input_free_device(sw->dev[i]);
next reply other threads:[~2006-05-07 2:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-07 2:03 Jesper Juhl [this message]
2006-05-30 3:49 ` [PATCH] fix mem-leak in sidewinder driver Dmitry Torokhov
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=200605070403.47763.jesper.juhl@gmail.com \
--to=jesper.juhl@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@ucw.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