mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karsten Keil <kkeil@suse.de>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: linux-kernel@vger.kernel.org, Karsten Keil <kkeil@suse.de>,
	Kai Germaschewski <kai.germaschewski@gmx.de>,
	isdn4linux@listserv.isdn4linux.de
Subject: Re: [PATCH] ISDN: fix a few resource leaks in sc_ioctl()
Date: Thu, 30 Mar 2006 10:51:53 +0200	[thread overview]
Message-ID: <20060330085153.GA1033@pingi.kke.suse.de> (raw)
In-Reply-To: <200603261616.25741.jesper.juhl@gmail.com>

On Sun, Mar 26, 2006 at 04:16:25PM +0200, Jesper Juhl wrote:
> 
> Fix a few resource 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>

> ---
> 
>  drivers/isdn/sc/ioctl.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> --- linux-2.6.16-mm1-orig/drivers/isdn/sc/ioctl.c	2006-03-20 06:53:29.000000000 +0100
> +++ linux-2.6.16-mm1/drivers/isdn/sc/ioctl.c	2006-03-26 16:11:49.000000000 +0200
> @@ -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;
>  		}
> 
> 

-- 
Karsten Keil
SuSE Labs
ISDN development

      reply	other threads:[~2006-03-30  8:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-26 14:16 Jesper Juhl
2006-03-30  8:51 ` Karsten Keil [this message]

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=20060330085153.GA1033@pingi.kke.suse.de \
    --to=kkeil@suse.de \
    --cc=isdn4linux@listserv.isdn4linux.de \
    --cc=jesper.juhl@gmail.com \
    --cc=kai.germaschewski@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®