• David Howells's avatar
    afs: Fix tracing deref-before-check · acc080d1
    David Howells authored
    The patch dca54a7b: "afs: Add tracing for cell refcount and active user
    count" from Oct 13, 2020, leads to the following Smatch complaint:
    
        fs/afs/cell.c:596 afs_unuse_cell()
        warn: variable dereferenced before check 'cell' (see line 592)
    
    Fix this by moving the retrieval of the cell debug ID to after the check of
    the validity of the cell pointer.
    Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
    Fixes: dca54a7b ("afs: Add tracing for cell refcount and active user count")
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    cc: Dan Carpenter <dan.carpenter@oracle.com>
    acc080d1
cell.c 23.7 KB