Re: [PATCH 6/7] tidspbridge: convert to idr_alloc()

From: Greg KH
Date: Tue Mar 05 2013 - 16:36:48 EST


On Tue, Mar 05, 2013 at 12:02:51PM -0800, Tejun Heo wrote:
> idr_get_new*() and friends are about to be deprecated. Convert to the
> new idr_alloc() interface.
>
> There are some peculiarities and possible bugs in the converted
> functions. This patch preserves those.
>
> * drv_insert_node_res_element() returns -ENOMEM on alloc failure,
> -EFAULT if id space is exhausted. -EFAULT is at best misleading.
>
> * drv_proc_insert_strm_res_element() is even weirder. It returns
> -EFAULT if kzalloc() fails, -ENOMEM if idr preloading fails and
> -EPERM if id space is exhausted. What's going on here?
>
> * drv_proc_insert_strm_res_element() doesn't free *pstrm_res after
> failure.
>
> Only compile tested.
>
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Víctor Manuel Jáquez Leal <vjaquez@xxxxxxxxxx>
> Cc: Rene Sapiens <rene.sapiens@xxxxxx>
> Cc: Armando Uribe <x0095078@xxxxxx>
> Cc: Omar Ramirez Luna <omar.ramirez@xxxxxx>
> ---
> drivers/staging/tidspbridge/rmgr/drv.c | 70 +++++++++++++---------------------
> 1 file changed, 26 insertions(+), 44 deletions(-)

Acked-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

--
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/