The value of req->out.h may be undefined when FR_ISREPLY is not set.

Signed-off-by: Li Wang <[email protected]>
---
 fs/fuse/virtio_fs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index 2f7485ffac52..dec2c5a30e4e 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -789,7 +789,8 @@ static void virtio_fs_request_complete(struct fuse_req *req,
        struct folio *folio;
 
        args = req->args;
-       copy_args_from_argbuf(args, req);
+       if (test_bit(FR_ISREPLY, &req->flags))
+               copy_args_from_argbuf(args, req);
 
        if (args->out_pages && args->page_zeroing) {
                len = args->out_args[args->out_numargs - 1].size;
-- 
2.34.1


Reply via email to