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-next>] [day] [month] [year] [list]
Message-ID: <20200818114235.51052-1-yuehaibing@huawei.com>
Date:   Tue, 18 Aug 2020 19:42:35 +0800
From:   YueHaibing <yuehaibing@...wei.com>
To:     <hare@...e.de>, <jejb@...ux.ibm.com>, <martin.petersen@...cle.com>
CC:     <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH] scsi: libfc: Fix passing zero to 'PTR_ERR' warning

drivers/scsi/libfc/fc_disc.c:304
 fc_disc_error() warn: passing zero to 'PTR_ERR'

fc_disc_error() expect a ERR_PTR pointer, so pass
ERR_PTR(err) to fix this.

Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
 drivers/scsi/libfc/fc_disc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index d8cbc9c0e766..1077fcff4d50 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -343,6 +343,7 @@ static void fc_disc_gpn_ft_req(struct fc_disc *disc)
 {
 	struct fc_frame *fp;
 	struct fc_lport *lport = fc_disc_lport(disc);
+	int err;
 
 	lockdep_assert_held(&disc->disc_mutex);
 
@@ -356,8 +357,10 @@ static void fc_disc_gpn_ft_req(struct fc_disc *disc)
 	fp = fc_frame_alloc(lport,
 			    sizeof(struct fc_ct_hdr) +
 			    sizeof(struct fc_ns_gid_ft));
-	if (!fp)
+	if (!fp) {
+		err = -ENOMEM;
 		goto err;
+	}
 
 	if (lport->tt.elsct_send(lport, 0, fp,
 				 FC_NS_GPN_FT,
@@ -365,7 +368,7 @@ static void fc_disc_gpn_ft_req(struct fc_disc *disc)
 				 disc, 3 * lport->r_a_tov))
 		return;
 err:
-	fc_disc_error(disc, NULL);
+	fc_disc_error(disc, ERR_PTR(err));
 }
 
 /**
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ