Re: [PATCH] simplify mqueue_inode_info->messages allocation

From: Chris Wright
Date: Wed May 05 2004 - 17:33:49 EST


* Marcelo Tosatti (marcelo.tosatti@xxxxxxxxxxxx) wrote:
> On Tue, May 04, 2004 at 06:37:22PM -0700, Chris Wright wrote:
> > * Chris Wright (chrisw@xxxxxxxx) wrote:
> > > --- ./ipc/mqueue.c~single_alloc 2004-05-04 15:16:34.000000000 -0700
> > > +++ ./ipc/mqueue.c~ 2004-05-04 15:59:25.000000000 -0700
> >
> > Ugh! Andrew pointed out to me that this is crap. Sorry about the added
> > noise. Here's a patch relative to a file that actually exists.
>
> While we're at it, in do_create:
>
> ret = vfs_create(dir->d_inode, dentry, mode, NULL);
> if (ret) {
> kfree(msgs);
> return ERR_PTR(ret);
>
> The msgs pointer can be NULL. Isnt that going to BUG if so?

kfree(NULL) is no-op. but if you look at this patch, that is gone
altogether.

thanks,
-chris

--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/