Commit 6ba22d8d authored by David Howells's avatar David Howells

netfs: Make netfs_put_request() handle a NULL pointer

Make netfs_put_request() just return if given a NULL request pointer.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
parent c6dc54dd
...@@ -106,10 +106,12 @@ static void netfs_free_request(struct work_struct *work) ...@@ -106,10 +106,12 @@ static void netfs_free_request(struct work_struct *work)
void netfs_put_request(struct netfs_io_request *rreq, bool was_async, void netfs_put_request(struct netfs_io_request *rreq, bool was_async,
enum netfs_rreq_ref_trace what) enum netfs_rreq_ref_trace what)
{ {
unsigned int debug_id = rreq->debug_id; unsigned int debug_id;
bool dead; bool dead;
int r; int r;
if (rreq) {
debug_id = rreq->debug_id;
dead = __refcount_dec_and_test(&rreq->ref, &r); dead = __refcount_dec_and_test(&rreq->ref, &r);
trace_netfs_rreq_ref(debug_id, r - 1, what); trace_netfs_rreq_ref(debug_id, r - 1, what);
if (dead) { if (dead) {
...@@ -121,6 +123,7 @@ void netfs_put_request(struct netfs_io_request *rreq, bool was_async, ...@@ -121,6 +123,7 @@ void netfs_put_request(struct netfs_io_request *rreq, bool was_async,
netfs_free_request(&rreq->work); netfs_free_request(&rreq->work);
} }
} }
}
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment