diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 702592cce546..abc00811f6f9 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -371,7 +371,7 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) struct fuse_iqueue *fiq = &fc->iq; if (test_and_set_bit(FR_FINISHED, &req->flags)) - return; + goto out_put_req; spin_lock(&fiq->waitq.lock); list_del_init(&req->intr_entry); @@ -400,6 +400,7 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) wake_up(&req->waitq); if (req->end) req->end(fc, req); +out_put_req: fuse_put_request(fc, req); } @@ -2108,6 +2109,7 @@ void fuse_abort_conn(struct fuse_conn *fc, bool is_abort) set_bit(FR_ABORTED, &req->flags); if (!test_bit(FR_LOCKED, &req->flags)) { set_bit(FR_PRIVATE, &req->flags); + __fuse_get_request(req); list_move(&req->list, &to_end1); } spin_unlock(&req->waitq.lock); @@ -2134,7 +2136,6 @@ void fuse_abort_conn(struct fuse_conn *fc, bool is_abort) while (!list_empty(&to_end1)) { req = list_first_entry(&to_end1, struct fuse_req, list); - __fuse_get_request(req); list_del_init(&req->list); request_end(fc, req); }