From f969af12ecd53cc1c5747c7e2c4bcff0784ce3db Mon Sep 17 00:00:00 2001 From: Jingbo Xu Date: Tue, 27 Dec 2022 11:52:56 +0800 Subject: [PATCH] anolis: cachefiles: fix potential NULL in error path ANBZ: #3213 When entering the error path, the request may not have been allocated or req->object may not have been initialized. Fixes: 5d1970fc484a ("anolis: cachefiles: resend an open request if the read request's object is closed") Reported-by: Jia Zhu Signed-off-by: Jingbo Xu --- fs/cachefiles/ondemand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cachefiles/ondemand.c b/fs/cachefiles/ondemand.c index 7a6af4de88ed..cf44e24849ca 100644 --- a/fs/cachefiles/ondemand.c +++ b/fs/cachefiles/ondemand.c @@ -468,7 +468,7 @@ static int cachefiles_ondemand_send_req(struct cachefiles_object *object, * cachefiles_ondemand_fd_release() will set object to close. */ if (opcode == CACHEFILES_OP_OPEN) - cachefiles_ondemand_set_object_close(req->object); + cachefiles_ondemand_set_object_close(object); kfree(req); return ret; } -- Gitee