diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2006-03-31 05:30:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-31 15:18:56 -0500 |
commit | d32af0fe11b1618572389723e93cf33a4cc11c81 (patch) | |
tree | cf0707e363626e24245dda57fc7c5851d89b7eeb /drivers/isdn | |
parent | b0b4ed728cdd0c7204392b0c18857e4a99917aa5 (diff) |
[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')
-rw-r--r-- | drivers/isdn/sc/ioctl.c | 9 |
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) | |||
46 | pr_debug("%s: SCIOCRESET: ioctl received\n", | 46 | pr_debug("%s: SCIOCRESET: ioctl received\n", |
47 | sc_adapter[card]->devicename); | 47 | sc_adapter[card]->devicename); |
48 | sc_adapter[card]->StartOnReset = 0; | 48 | sc_adapter[card]->StartOnReset = 0; |
49 | return (reset(card)); | 49 | kfree(rcvmsg); |
50 | return reset(card); | ||
50 | } | 51 | } |
51 | 52 | ||
52 | case SCIOCLOAD: | 53 | case SCIOCLOAD: |
@@ -183,7 +184,7 @@ int sc_ioctl(int card, scs_ioctl *data) | |||
183 | sc_adapter[card]->devicename); | 184 | sc_adapter[card]->devicename); |
184 | 185 | ||
185 | spid = kmalloc(SCIOC_SPIDSIZE, GFP_KERNEL); | 186 | spid = kmalloc(SCIOC_SPIDSIZE, GFP_KERNEL); |
186 | if(!spid) { | 187 | if (!spid) { |
187 | kfree(rcvmsg); | 188 | kfree(rcvmsg); |
188 | return -ENOMEM; | 189 | return -ENOMEM; |
189 | } | 190 | } |
@@ -195,10 +196,10 @@ int sc_ioctl(int card, scs_ioctl *data) | |||
195 | if (!status) { | 196 | if (!status) { |
196 | pr_debug("%s: SCIOCGETSPID: command successful\n", | 197 | pr_debug("%s: SCIOCGETSPID: command successful\n", |
197 | sc_adapter[card]->devicename); | 198 | sc_adapter[card]->devicename); |
198 | } | 199 | } else { |
199 | else { | ||
200 | pr_debug("%s: SCIOCGETSPID: command failed (status = %d)\n", | 200 | pr_debug("%s: SCIOCGETSPID: command failed (status = %d)\n", |
201 | sc_adapter[card]->devicename, status); | 201 | sc_adapter[card]->devicename, status); |
202 | kfree(spid); | ||
202 | kfree(rcvmsg); | 203 | kfree(rcvmsg); |
203 | return status; | 204 | return status; |
204 | } | 205 | } |