Re: [PATCH 12/12] ipc/util.c: Further ipc_idr_alloc cleanups.

2018-07-09 Thread Dmitry Vyukov
On Mon, Jul 9, 2018 at 8:22 PM, Manfred Spraul wrote: > Hello Dmitry, > > > On 07/09/2018 07:05 PM, Dmitry Vyukov wrote: >> >> On Mon, Jul 9, 2018 at 5:10 PM, Manfred Spraul >> wrote: >>> >>> If idr_alloc within ipc_idr_alloc fails, then the return value (-ENOSPC) >>> is used to calculate

Re: [PATCH 12/12] ipc/util.c: Further ipc_idr_alloc cleanups.

2018-07-09 Thread Dmitry Vyukov
On Mon, Jul 9, 2018 at 8:22 PM, Manfred Spraul wrote: > Hello Dmitry, > > > On 07/09/2018 07:05 PM, Dmitry Vyukov wrote: >> >> On Mon, Jul 9, 2018 at 5:10 PM, Manfred Spraul >> wrote: >>> >>> If idr_alloc within ipc_idr_alloc fails, then the return value (-ENOSPC) >>> is used to calculate

Re: [PATCH 12/12] ipc/util.c: Further ipc_idr_alloc cleanups.

2018-07-09 Thread Manfred Spraul
Hello Dmitry, On 07/09/2018 07:05 PM, Dmitry Vyukov wrote: On Mon, Jul 9, 2018 at 5:10 PM, Manfred Spraul wrote: If idr_alloc within ipc_idr_alloc fails, then the return value (-ENOSPC) is used to calculate new->id. Technically, this is not a bug, because new->id is never accessed. But:

Re: [PATCH 12/12] ipc/util.c: Further ipc_idr_alloc cleanups.

2018-07-09 Thread Manfred Spraul
Hello Dmitry, On 07/09/2018 07:05 PM, Dmitry Vyukov wrote: On Mon, Jul 9, 2018 at 5:10 PM, Manfred Spraul wrote: If idr_alloc within ipc_idr_alloc fails, then the return value (-ENOSPC) is used to calculate new->id. Technically, this is not a bug, because new->id is never accessed. But:

Re: [PATCH 12/12] ipc/util.c: Further ipc_idr_alloc cleanups.

2018-07-09 Thread Dmitry Vyukov
On Mon, Jul 9, 2018 at 5:10 PM, Manfred Spraul wrote: > If idr_alloc within ipc_idr_alloc fails, then the return value (-ENOSPC) > is used to calculate new->id. > Technically, this is not a bug, because new->id is never accessed. > > But: Clean it up anyways: On error, just return, do not set

Re: [PATCH 12/12] ipc/util.c: Further ipc_idr_alloc cleanups.

2018-07-09 Thread Dmitry Vyukov
On Mon, Jul 9, 2018 at 5:10 PM, Manfred Spraul wrote: > If idr_alloc within ipc_idr_alloc fails, then the return value (-ENOSPC) > is used to calculate new->id. > Technically, this is not a bug, because new->id is never accessed. > > But: Clean it up anyways: On error, just return, do not set

[PATCH 12/12] ipc/util.c: Further ipc_idr_alloc cleanups.

2018-07-09 Thread Manfred Spraul
If idr_alloc within ipc_idr_alloc fails, then the return value (-ENOSPC) is used to calculate new->id. Technically, this is not a bug, because new->id is never accessed. But: Clean it up anyways: On error, just return, do not set new->id. And improve the documentation. Signed-off-by: Manfred

[PATCH 12/12] ipc/util.c: Further ipc_idr_alloc cleanups.

2018-07-09 Thread Manfred Spraul
If idr_alloc within ipc_idr_alloc fails, then the return value (-ENOSPC) is used to calculate new->id. Technically, this is not a bug, because new->id is never accessed. But: Clean it up anyways: On error, just return, do not set new->id. And improve the documentation. Signed-off-by: Manfred