lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM6PR05MB5014AED9AF55149641D2E7FFD8D00@AM6PR05MB5014.eurprd05.prod.outlook.com>
Date:   Fri, 24 Apr 2020 01:17:59 +0000
From:   Yanjun Zhu <yanjunz@...lanox.com>
To:     Sudip Mukherjee <sudipm.mukherjee@...il.com>,
        Doug Ledford <dledford@...hat.com>,
        Jason Gunthorpe <jgg@...pe.ca>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>
Subject: RE: [PATCH] RDMA/rxe: check for error

Thanks,
Reviewed-by: Zhu Yanjun <yanjunz@...lanox.com>

-----Original Message-----
From: Sudip Mukherjee <sudipm.mukherjee@...il.com> 
Sent: Thursday, April 23, 2020 6:48 PM
To: Yanjun Zhu <yanjunz@...lanox.com>; Doug Ledford <dledford@...hat.com>; Jason Gunthorpe <jgg@...pe.ca>
Cc: linux-kernel@...r.kernel.org; linux-rdma@...r.kernel.org; Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH] RDMA/rxe: check for error

rxe_create_mmap_info() returns either NULL or an error value in ERR_PTR and we only checked for NULL after return. We should be using IS_ERR_OR_NULL to check for both.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@...il.com>
---
 drivers/infiniband/sw/rxe/rxe_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_queue.c b/drivers/infiniband/sw/rxe/rxe_queue.c
index ff92704de32f..ef438ce4fcfa 100644
--- a/drivers/infiniband/sw/rxe/rxe_queue.c
+++ b/drivers/infiniband/sw/rxe/rxe_queue.c
@@ -45,7 +45,7 @@ int do_mmap_info(struct rxe_dev *rxe, struct mminfo __user *outbuf,
 
 	if (outbuf) {
 		ip = rxe_create_mmap_info(rxe, buf_size, udata, buf);
-		if (!ip)
+		if (IS_ERR_OR_NULL(ip))
 			goto err1;
 
 		err = copy_to_user(outbuf, &ip->info, sizeof(ip->info));
--
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ