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: <20220602101543.44276-1-linmq006@gmail.com>
Date:   Thu,  2 Jun 2022 14:15:43 +0400
From:   Miaoqian Lin <linmq006@...il.com>
To:     Dinh Nguyen <dinguyen@...nel.org>,
        Richard Gong <richard.gong@...el.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Alan Tull <atull@...nel.org>, linux-kernel@...r.kernel.org
Cc:     linmq006@...il.com
Subject: [PATCH v2] firmware: stratix10-svc: fix NULL vs IS_ERR() checking

The svc_create_memory_pool function does not return NULL. It
returns error pointers.

Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
Changes in v2:
- add Fixes tag.
Link: https://lore.kernel.org/r/20211211051320.2206-1-linmq006@gmail.com
---
 drivers/firmware/stratix10-svc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
index 8177a0fae11d..132ea721c9a0 100644
--- a/drivers/firmware/stratix10-svc.c
+++ b/drivers/firmware/stratix10-svc.c
@@ -996,8 +996,8 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)
 		return ret;
 
 	genpool = svc_create_memory_pool(pdev, sh_memory);
-	if (!genpool)
-		return -ENOMEM;
+	if (IS_ERR(genpool))
+		return PTR_ERR(genpool);
 
 	/* allocate service controller and supporting channel */
 	controller = devm_kzalloc(dev, sizeof(*controller), GFP_KERNEL);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ