From: Miaoqian Lin <linmq006@gmail.com>
To: Dinh Nguyen <dinguyen@kernel.org>,
Richard Gong <richard.gong@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alan Tull <atull@kernel.org>,
linux-kernel@vger.kernel.org
Cc: linmq006@gmail.com
Subject: [PATCH v2] firmware: stratix10-svc: fix NULL vs IS_ERR() checking
Date: Thu, 2 Jun 2022 14:15:43 +0400 [thread overview]
Message-ID: <20220602101543.44276-1-linmq006@gmail.com> (raw)
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@gmail.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
reply other threads:[~2022-06-02 10:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220602101543.44276-1-linmq006@gmail.com \
--to=linmq006@gmail.com \
--cc=atull@kernel.org \
--cc=dinguyen@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard.gong@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®