]> 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)
commitc82a4958addb143ec7366d36bdc0a45f24330e9f
treed707ba3cf63ea76f91ce993571396f3c93d05d3b
parent8a457130fb0646b0db94216d2b357d85c8ec9e26
afs: Fix tracing deref-before-check

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