In pipe(2), create_write_pipe() creates a dentry by
struct qstr name = { .name = "" };
d_alloc(root, &name);
But d_alloc() refers name->len which is uninitialized.
Isn't it better to replace d_alloc() by d_alloc_name(root, "")?
J. R. Okajima
On Tue, Dec 29, 2009 at 02:55:20PM +0900, [email protected] wrote:
>
>In pipe(2), create_write_pipe() creates a dentry by
> struct qstr name = { .name = "" };
> d_alloc(root, &name);
>
>But d_alloc() refers name->len which is uninitialized.
Well, it is initialized to 0. :)
>Isn't it better to replace d_alloc() by d_alloc_name(root, "")?
>
Maybe not, they totally equal in this case, IMO.
--
Live like a child, think like the god.
Amrico Wang:
> >But d_alloc() refers name->len which is uninitialized.
>
> Well, it is initialized to 0. :)
I didn't know that.
Thanx.
J. R. Okajima
[email protected] wrote:
> In pipe(2), create_write_pipe() creates a dentry by
> struct qstr name = { .name = "" };
> d_alloc(root, &name);
>
> But d_alloc() refers name->len which is uninitialized.
> Isn't it better to replace d_alloc() by d_alloc_name(root, "")?
>
If readability counts, I would say so. Functionally I don't know, I can't see
any problems other than it's unobvious.
--
Bill Davidsen <[email protected]>
"We have more to fear from the bungling of the incompetent than from
the machinations of the wicked." - from Slashdot