aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2021-03-18 16:09:37 +0300
committerSteve French <[email protected]>2021-05-10 19:15:20 -0500
commit8ef32967065737dac51974efae333436354bea0a (patch)
tree5bc05911f98f11fcc59a843a72646e3f86a1269f
parent86df49e105afa6a205abb7d90809c3c76136eaa9 (diff)
cifsd: fix a IS_ERR() vs NULL bug
The smb_direct_alloc_sendmsg() function never returns NULL, it only returns error pointers so the check needs to be updated. Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
-rw-r--r--fs/cifsd/transport_rdma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifsd/transport_rdma.c b/fs/cifsd/transport_rdma.c
index 4f4806d67ab0..d235051dc5b1 100644
--- a/fs/cifsd/transport_rdma.c
+++ b/fs/cifsd/transport_rdma.c
@@ -997,8 +997,8 @@ static int smb_direct_create_header(struct smb_direct_transport *t,
int ret;
sendmsg = smb_direct_alloc_sendmsg(t);
- if (!sendmsg)
- return -ENOMEM;
+ if (IS_ERR(sendmsg))
+ return PTR_ERR(sendmsg);
/* Fill in the packet header */
packet = (struct smb_direct_data_transfer *)sendmsg->packet;