Skip to content

Commit bf730b3

Browse files
lostjefflezychao66
authored andcommitted
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: 5d1970f ("anolis: cachefiles: resend an open request if the read request's object is closed") Reported-by: Jia Zhu <[email protected]> Signed-off-by: Jingbo Xu <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Link: https://gitee.com/anolis/cloud-kernel/pulls/1022
1 parent a5a0ae7 commit bf730b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cachefiles/ondemand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ static int cachefiles_ondemand_send_req(struct cachefiles_object *object,
468468
* cachefiles_ondemand_fd_release() will set object to close.
469469
*/
470470
if (opcode == CACHEFILES_OP_OPEN)
471-
cachefiles_ondemand_set_object_close(req->object);
471+
cachefiles_ondemand_set_object_close(object);
472472
kfree(req);
473473
return ret;
474474
}

0 commit comments

Comments
 (0)