From: Yang Yingliang <yangyingliang@huawei.com>
To: <coresight@lists.linaro.org>, <linux-arm-kernel@lists.infradead.org>
Cc: <mathieu.poirier@linaro.org>, <suzuki.poulose@arm.com>,
<mike.leach@linaro.org>, <leo.yan@linaro.org>,
<alexander.shishkin@linux.intel.com>, <hejunhao3@huawei.com>,
<Jonathan.Cameron@huawei.com>, <yangyingliang@huawei.com>
Subject: [PATCH -next] coresight: ultrasoc-smb: fix return value check in smb_init_data_buffer()
Date: Wed, 18 Jan 2023 15:49:20 +0800 [thread overview]
Message-ID: <20230118074920.1772141-1-yangyingliang@huawei.com> (raw)
platform_get_resource() returns NULL pointer not PTR_ERR(), replace
the IS_ERR() check with NULL pointer check.
Fixes: 06f5c2926aaa ("drivers/coresight: Add UltraSoc System Memory Buffer driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/hwtracing/coresight/ultrasoc-smb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwtracing/coresight/ultrasoc-smb.c b/drivers/hwtracing/coresight/ultrasoc-smb.c
index 2560fdbb8ebf..b317342c7ce5 100644
--- a/drivers/hwtracing/coresight/ultrasoc-smb.c
+++ b/drivers/hwtracing/coresight/ultrasoc-smb.c
@@ -455,7 +455,7 @@ static int smb_init_data_buffer(struct platform_device *pdev,
void *base;
res = platform_get_resource(pdev, IORESOURCE_MEM, SMB_BUF_ADDR_RES);
- if (IS_ERR(res)) {
+ if (!res) {
dev_err(&pdev->dev, "SMB device failed to get resource\n");
return -EINVAL;
}
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2023-01-18 7:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 7:49 Yang Yingliang [this message]
2023-01-19 10:03 ` [PATCH -next] coresight: ultrasoc-smb: fix return value check in smb_init_data_buffer() Suzuki K Poulose
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=20230118074920.1772141-1-yangyingliang@huawei.com \
--to=yangyingliang@huawei.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=coresight@lists.linaro.org \
--cc=hejunhao3@huawei.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=suzuki.poulose@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.