Commit b9f83ffa authored by Yunjian Wang's avatar Yunjian Wang Committed by Chuck Lever
Browse files

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: 5191955d ("SUNRPC: Prepare for xdr_stream-style decoding on the server-side")
Signed-off-by: default avatarYunjian Wang <wangyunjian@huawei.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent cb579086
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -846,6 +846,7 @@ void
svc_rqst_free(struct svc_rqst *rqstp)
{
	svc_release_buffer(rqstp);
	if (rqstp->rq_scratch_page)
		put_page(rqstp->rq_scratch_page);
	kfree(rqstp->rq_resp);
	kfree(rqstp->rq_argp);