Thread (11 messages) 11 messages, 6 authors, 2007-12-01

Re: [EXT4 set 6][PATCH 1/1]Export jbd stats through procfs

From: Alexey Dobriyan <hidden>
Date: 2007-07-11 04:37:58
Also in: linux-fsdevel, lkml

On Tue, Jul 10, 2007 at 11:21:49PM -0400, Cédric Augonnet wrote:
2007/7/10, Andrew Morton [off-list ref]:

Hi all,
quoted
quoted
+     size = sizeof(struct transaction_stats_s);
+     s->stats = kmalloc(size, GFP_KERNEL);
+     if (s == NULL) {
	       ^
quoted
quoted
+             kfree(s);
+             return -EIO;
ENOMEM
That, and

	if (s->stats == NULL)
		kfree(s);
I'm sorry if i missed some point, but i just don't see the use of such
a kfree here, not sure Andrew meant you should only return ENOMEM
instead, but why issuing those kfree(NULL), instead of just a if (!s)
return ENOMEM ?
kfree() is correct, check isn't.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help