Re: [GIT PULL] afs, rxrpc: Clean up refcounting on afs_cell and afs_server records

From: David Howells
Date: Sat Mar 01 2025 - 08:24:02 EST


David Howells <dhowells@xxxxxxxxxx> wrote:

> cell->dynroot_ino = idr_alloc_cyclic(&net->cells_dyn_ino, cell,
> 2, INT_MAX / 2, GFP_KERNEL);
> - if (cell->dynroot_ino < 0)
> + if ((int)cell->dynroot_ino < 0)
> goto error;

That's not right. I need to copy the error into 'ret' before jumping to
error. Probably better to do:

ret = idr_alloc_cyclic(&net->cells_dyn_ino, cell,
2, INT_MAX / 2, GFP_KERNEL);
if (ret < 0)
goto error;
cell->dynroot_ino = ret;

David