Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] Re: [PATCH][2.5.53] Memory leak in drivers/video/console/sticore.c
       [not found] <Pine.LNX.4.33.0212282311540.268-100000@pablo.menichini.com.ar>
  2003-01-05 15:06 ` [parisc-linux] Re: [PATCH][2.5.53] Memory leak in drivers/video/console/sticore.c Matthew Wilcox
@ 2003-01-05 15:06 ` Matthew Wilcox
  1 sibling, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2003-01-05 15:06 UTC (permalink / raw)
  To: Pablo Menichini
  Cc: kernel-janitor-discuss, Trivial Patch Monkey, parisc-linux

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [parisc-linux] Re: [PATCH][2.5.53] Memory leak in drivers/video/console/sticore.c
       [not found] <Pine.LNX.4.33.0212282311540.268-100000@pablo.menichini.com.ar>
@ 2003-01-05 15:06 ` Matthew Wilcox
  2003-01-05 15:06 ` Matthew Wilcox
  1 sibling, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2003-01-05 15:06 UTC (permalink / raw)
  To: Pablo Menichini
  Cc: kernel-janitor-discuss, Trivial Patch Monkey, parisc-linux

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-05 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.33.0212282311540.268-100000@pablo.menichini.com.ar>
2003-01-05 15:06 ` [parisc-linux] Re: [PATCH][2.5.53] Memory leak in drivers/video/console/sticore.c Matthew Wilcox
2003-01-05 15:06 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox