xprtrdma: fix pointer derefs in error cases of rpcrdma_ep_create
authorDan Aloni <dan.aloni@vastdata.com>
Tue, 25 Jan 2022 20:06:46 +0000 (22:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Feb 2022 11:01:06 +0000 (12:01 +0100)
commit1e7433fb95ccc01629a5edaa4ced0cd8c98d0ae0
tree38438928334af751b58b0b72c51105aa2394c327
parenta21f472fb5cc9b08a2a31e19a5b89338c0bd921d
xprtrdma: fix pointer derefs in error cases of rpcrdma_ep_create

[ Upstream commit a9c10b5b3b67b3750a10c8b089b2e05f5e176e33 ]

If there are failures then we must not leave the non-NULL pointers with
the error value, otherwise `rpcrdma_ep_destroy` gets confused and tries
free them, resulting in an Oops.

Signed-off-by: Dan Aloni <dan.aloni@vastdata.com>
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sunrpc/xprtrdma/verbs.c