afs: Fix tracing deref-before-check
authorDavid Howells <dhowells@redhat.com>
Tue, 27 Oct 2020 10:42:56 +0000 (10:42 +0000)
committerDavid Howells <dhowells@redhat.com>
Tue, 27 Oct 2020 22:05:56 +0000 (22:05 +0000)
commitacc080d15dde820bd39eb55a04f9a09c7ef52e67
treed707ba3cf63ea76f91ce993571396f3c93d05d3b
parent06a17bbe1d47fec6232505c355b367797f6a635c
afs: Fix tracing deref-before-check

The patch dca54a7bbb8c: "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: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: dca54a7bbb8c ("afs: Add tracing for cell refcount and active user count")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Dan Carpenter <dan.carpenter@oracle.com>
fs/afs/cell.c