Re: [PATCH] [STACK] reduce >3k call path in ide
From: Jörn Engel <hidden>
Date: 2004-06-16 18:29:23
Also in:
lkml
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