mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
SUNRPC: Fix null pointer dereference in svc_rqst_free()
When alloc_pages_node() returns null in svc_rqst_alloc(), the
null rq_scratch_page pointer will be dereferenced when calling
put_page() in svc_rqst_free(). Fix it by adding a null check.
Addresses-Coverity: ("Dereference after null check")
Fixes: 5191955d6f
("SUNRPC: Prepare for xdr_stream-style decoding on the server-side")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
cb57908653
commit
b9f83ffaa0
@ -846,7 +846,8 @@ void
|
||||
svc_rqst_free(struct svc_rqst *rqstp)
|
||||
{
|
||||
svc_release_buffer(rqstp);
|
||||
put_page(rqstp->rq_scratch_page);
|
||||
if (rqstp->rq_scratch_page)
|
||||
put_page(rqstp->rq_scratch_page);
|
||||
kfree(rqstp->rq_resp);
|
||||
kfree(rqstp->rq_argp);
|
||||
kfree(rqstp->rq_auth_data);
|
||||
|
Loading…
Reference in New Issue
Block a user