]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit534efdfab86c4012be9ecf0cf9e9d9d60bdfacb5
treed707ba3cf63ea76f91ce993571396f3c93d05d3b
parente2ed117b43612d92477d470b1c8a49d302df9a33
afs: Fix tracing deref-before-check

The patch c7e7548c3de8: "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: c7e7548c3de8 ("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