[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130923150625.GB14547@htj.dyndns.org>
Date: Mon, 23 Sep 2013 11:06:25 -0400
From: Tejun Heo <tj@...nel.org>
To: Chen Gang <gang.chen@...anux.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Michael Kerrisk <mtk.manpages@...il.com>
Subject: Re: [PATCH] kernel/groups.c: consider about NULL for 'group_info' in
all related extern functions
Hello,
(I have no idea about this but Andrew tagged me, probably thinking it
was related to cgroups, so here it goes ;)
On Tue, Aug 20, 2013 at 11:01:14AM +0800, Chen Gang wrote:
> groups_alloc() can return NULL for 'group_info', also group_search()
> already considers about NULL for 'group_info', so can assume the caller
> has right to use all related extern functions when 'group_info' is NULL.
>
> For groups_free(), need check NULL to match groups_alloc(), just like
> kmalloc/free().
While it is somewhat customary to make free routines handle NULL
inputs, the convention isn't a very strong one and given that the
above change doesn't actually benefit any of the existing use cases,
it seems gratuituous.
> For set_groups(), can allow the caller to set NULL parameter to new
> 'cred'.
>
> For system call getgroups(), if 'cred->group_info' is NULL, need return
> the related error code (no related data), also need change the related
> man page ("man 2 getgroups") to complete the return value.
How can cred->group_info be NULL? Can you please describe what issue
this patch is trying to solve / improve? The patch description
explains what's being changed but doesn't really offer why such
changes are being made. Can you please explain why this change is
beneficial?
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists