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

David Howells dhowells at redhat.com
Sat Mar 1 05:23:24 PST 2025


David Howells <dhowells at redhat.com> 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




More information about the linux-afs mailing list