]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Fix null pointer dereference in svc_rqst_free()
authorYunjian Wang <wangyunjian@huawei.com>
Fri, 23 Apr 2021 09:42:58 +0000 (17:42 +0800)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 23 Apr 2021 14:43:05 +0000 (10:43 -0400)
commitb11e6987cb89df8adcb5989155b4db183582485c
treef1a9a914fdf8921546748669858823868db60098
parent240dec18c05191ec9d994fee7212f881dd33836b
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: a69577b85d9b ("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>
net/sunrpc/svc.c