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>] [day] [month] [year] [list]
Message-ID: <YMCJv0sYKm+Gcwr7@mwanda>
Date:   Wed, 9 Jun 2021 12:28:31 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Shai Malin <smalin@...vell.com>
Cc:     Ariel Elior <aelior@...vell.com>, Keith Busch <kbusch@...nel.org>,
        Jens Axboe <axboe@...com>, Christoph Hellwig <hch@....de>,
        Sagi Grimberg <sagi@...mberg.me>,
        Igor Russkikh <irusskikh@...vell.com>,
        "David S. Miller" <davem@...emloft.net>,
        Hannes Reinecke <hare@...e.de>, linux-nvme@...ts.infradead.org,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH] nvme-tcp-offload: Fix error code in
 nvme_tcp_ofld_create_ctrl()

Return an error pointer if try_module_get() fails.  Currently it returns
NULL.

Fixes: 4b8178ec5794 ("nvme-tcp-offload: Add device scan implementation")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
 drivers/nvme/host/tcp-offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/tcp-offload.c b/drivers/nvme/host/tcp-offload.c
index c76822e5ada7..c07f84a7e697 100644
--- a/drivers/nvme/host/tcp-offload.c
+++ b/drivers/nvme/host/tcp-offload.c
@@ -1215,7 +1215,7 @@ nvme_tcp_ofld_create_ctrl(struct device *ndev, struct nvmf_ctrl_options *opts)
 	/* Increase driver refcnt */
 	if (!try_module_get(dev->ops->module)) {
 		pr_err("try_module_get failed\n");
-		dev = NULL;
+		rc = -ENODEV;
 		goto out_free_ctrl;
 	}
 
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ