All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] cifsd: fix a IS_ERR() vs NULL bug
@ 2021-03-18 13:11 Dan Carpenter
  2021-03-19  4:43 ` Sergey Senozhatsky
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-03-18 13:11 UTC (permalink / raw)
  To: Namjae Jeon
  Cc: Hyunchul Lee, Steve French, Ronnie Sahlberg, Sergey Senozhatsky,
	linux-kernel, kernel-janitors, linux-cifs

The smb_direct_alloc_sendmsg() function never returns NULL, it only
returns error pointers so the check needs to be updated.

Fixes: cabcebc31de4 ("cifsd: introduce SMB3 kernel server")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
RESEND: Oops.  I forgot to CC linux-cifs on this.

 fs/cifsd/transport_rdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/cifsd/transport_rdma.c b/fs/cifsd/transport_rdma.c
index 1698f7ed9c2f..638b551019a1 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;
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] cifsd: fix a IS_ERR() vs NULL bug
  2021-03-18 13:11 [PATCH RESEND] cifsd: fix a IS_ERR() vs NULL bug Dan Carpenter
@ 2021-03-19  4:43 ` Sergey Senozhatsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Senozhatsky @ 2021-03-19  4:43 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Namjae Jeon, Hyunchul Lee, Steve French, Ronnie Sahlberg,
	Sergey Senozhatsky, linux-kernel, kernel-janitors, linux-cifs

On (21/03/18 16:11), Dan Carpenter wrote:
> 
> The smb_direct_alloc_sendmsg() function never returns NULL, it only
> returns error pointers so the check needs to be updated.
> 
> Fixes: cabcebc31de4 ("cifsd: introduce SMB3 kernel server")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks.

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

	-ss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-19  4:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 13:11 [PATCH RESEND] cifsd: fix a IS_ERR() vs NULL bug Dan Carpenter
2021-03-19  4:43 ` Sergey Senozhatsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.