Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@debian.org>
To: Pablo Menichini <pablo@menichini.com.ar>
Cc: kernel-janitor-discuss@lists.sourceforge.net,
	Trivial Patch Monkey <trivial@rustcorp.com.au>,
	parisc-linux@parisc-linux.org
Subject: [parisc-linux] Re: [PATCH][2.5.53] Memory leak in drivers/video/console/sticore.c
Date: Sun, 5 Jan 2003 15:06:46 +0000	[thread overview]
Message-ID: <20030105150646.H19239@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.33.0212282311540.268-100000@pablo.menichini.com.ar>; from pablo@menichini.com.ar on Sat, Dec 28, 2002 at 11:14:52PM -0300

On Sat, Dec 28, 2002 at 11:14:52PM -0300, Pablo Menichini wrote:
> This patch tries to fix the memory leak in function sti_init_glob_cfg.

sticore is somewhat out of date in Linus' tree -- probably better to
ignore drivers/video for cleanup work at the moment as there's some big
reworks in progress.  Even so, this patch is still mostly relevant --
I'll redo it in the PA-RISC tree shortly.  Thanks.

> --- linux-2.5.53/drivers/video/console/sticore.c	Sat Dec 28 18:39:32 2002
> +++ linux-local/drivers/video/console/sticore.c	Sat Dec 28 18:51:04 2002
> @@ -376,8 +376,17 @@
>  	save_addr = kmalloc(1024 /*XXX*/, GFP_KERNEL);
>  	sti_mem_addr = kmalloc(1024, GFP_KERNEL);
> 
> -	if((!glob_cfg) || (!glob_cfg_ext) || (!save_addr) || (!sti_mem_addr))
> +	if((!glob_cfg) || (!glob_cfg_ext) || (!save_addr) || (!sti_mem_addr)){
> +		if(glob_cfg)
> +			kfree(glob_cfg);
> +		if(glob_cfg_ext)
> +			kfree(glob_cfg_ext);
> +		if(save_addr)
> +			kfree(save_addr);
> +		if(sti_mem_addr)
> +			kfree(sti_mem_addr);
>  		return;
> +	}
> 
>  	memset(glob_cfg, 0, sizeof *glob_cfg);
>  	memset(glob_cfg_ext, 0, sizeof *glob_cfg_ext);

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

       reply	other threads:[~2003-01-05 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.33.0212282311540.268-100000@pablo.menichini.com.ar>
2003-01-05 15:06 ` Matthew Wilcox [this message]
2003-01-05 15:06 ` [parisc-linux] Re: [PATCH][2.5.53] Memory leak in drivers/video/console/sticore.c Matthew Wilcox

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=20030105150646.H19239@parcelfarce.linux.theplanet.co.uk \
    --to=willy@debian.org \
    --cc=kernel-janitor-discuss@lists.sourceforge.net \
    --cc=pablo@menichini.com.ar \
    --cc=parisc-linux@parisc-linux.org \
    --cc=trivial@rustcorp.com.au \
    /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