summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/sc
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2006-03-31 02:30:57 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-31 12:18:56 -0800
commitd32af0fe11b1618572389723e93cf33a4cc11c81 (patch)
treecf0707e363626e24245dda57fc7c5851d89b7eeb /drivers/isdn/sc
parentb0b4ed728cdd0c7204392b0c18857e4a99917aa5 (diff)
downloadlinux-d32af0fe11b1618572389723e93cf33a4cc11c81.tar.gz
linux-d32af0fe11b1618572389723e93cf33a4cc11c81.tar.bz2
linux-d32af0fe11b1618572389723e93cf33a4cc11c81.zip
[PATCH] ISDN: fix a few memory leaks in sc_ioctl()
Fix a few memory leaks in drivers/isdn/sc/ioctl.c::sc_ioctl() Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn/sc')
-rw-r--r--drivers/isdn/sc/ioctl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c
index 94c9afb7017c..f4f71226a078 100644
--- a/drivers/isdn/sc/ioctl.c
+++ b/drivers/isdn/sc/ioctl.c
@@ -46,7 +46,8 @@ int sc_ioctl(int card, scs_ioctl *data)
pr_debug("%s: SCIOCRESET: ioctl received\n",
sc_adapter[card]->devicename);
sc_adapter[card]->StartOnReset = 0;
- return (reset(card));
+ kfree(rcvmsg);
+ return reset(card);
}
case SCIOCLOAD:
@@ -183,7 +184,7 @@ int sc_ioctl(int card, scs_ioctl *data)
sc_adapter[card]->devicename);
spid = kmalloc(SCIOC_SPIDSIZE, GFP_KERNEL);
- if(!spid) {
+ if (!spid) {
kfree(rcvmsg);
return -ENOMEM;
}
@@ -195,10 +196,10 @@ int sc_ioctl(int card, scs_ioctl *data)
if (!status) {
pr_debug("%s: SCIOCGETSPID: command successful\n",
sc_adapter[card]->devicename);
- }
- else {
+ } else {
pr_debug("%s: SCIOCGETSPID: command failed (status = %d)\n",
sc_adapter[card]->devicename, status);
+ kfree(spid);
kfree(rcvmsg);
return status;
}