lkml.org 
[lkml]   [2004]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [STACK] reduce >3k call path in ide
On Wed, 16 June 2004 11:16:21 -0700, Randy.Dunlap wrote:
> On Wed, 16 Jun 2004 19:57:30 +0200 Jörn Engel wrote:
>
> | On Wed, 16 June 2004 10:37:41 -0700, Randy.Dunlap wrote:
> | >
> | > Thanks for the helpful comments. Here's a corrected patch.
> |
> | Looks, as if it still leaks memory:
>
> duh. fudge. Thanks. How's this one?

Just four more lines?

> link->dev = &info->node;
> printk(KERN_INFO "ide-cs: %s: Vcc = %d.%d, Vpp = %d.%d\n",
> - info->node.dev_name, link->conf.Vcc/10, link->conf.Vcc%10,
> - link->conf.Vpp1/10, link->conf.Vpp1%10);
> + info->node.dev_name, link->conf.Vcc / 10, link->conf.Vcc % 10,
> + link->conf.Vpp1 / 10, link->conf.Vpp1 % 10);
>
> link->state &= ~DEV_CONFIG_PENDING;
+ kfree(cisparse);
+ kfree(cfginfo);
+ kfree(def_cte);
+ kfree(tbuf);
> return;
> -
> +
> +err_mem:
> + printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n");
> + goto failed;
> +
> cs_failed:
> cs_error(link->handle, last_fn, last_ret);
> failed:
> + kfree(cisparse);
> + kfree(cfginfo);
> + kfree(def_cte);
> + kfree(tbuf);
> +
> ide_release(link);
> link->state &= ~DEV_CONFIG_PENDING;
> -
> } /* ide_config */
>
> /*======================================================================

Jörn

--
Fancy algorithms are slow when n is small, and n is usually small.
Fancy algorithms have big constants. Until you know that n is
frequently going to be big, don't get fancy.
-- Rob Pike
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.092 / U:1.188 seconds]
©2003-2014 Jasper Spaans. Advertise on this site