From: Dan Carpenter <dan.carpenter@oracle.com>
To: Vignesh Raghavendra <vigneshr@ti.com>,
Julien Panis <jpanis@baylibre.com>
Cc: William Breathitt Gray <william.gray@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-iio@vger.kernel.org, linux-omap@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check
Date: Wed, 12 Oct 2022 17:51:25 +0300 [thread overview]
Message-ID: <Y0bUbZvfDJHBG9C6@kili> (raw)
The devm_counter_alloc() function returns NULL on error. It doesn't
return error pointers.
Fixes: 4e2f42aa00b6 ("counter: ti-ecap-capture: capture driver support for ECAP")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/counter/ti-ecap-capture.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c
index af10de30aba5..8104d02bb5a4 100644
--- a/drivers/counter/ti-ecap-capture.c
+++ b/drivers/counter/ti-ecap-capture.c
@@ -479,8 +479,8 @@ static int ecap_cnt_probe(struct platform_device *pdev)
int ret;
counter_dev = devm_counter_alloc(dev, sizeof(*ecap_dev));
- if (IS_ERR(counter_dev))
- return PTR_ERR(counter_dev);
+ if (!counter_dev)
+ return -ENOMEM;
counter_dev->name = ECAP_DRV_NAME;
counter_dev->parent = dev;
--
2.35.1
next reply other threads:[~2022-10-12 14:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 14:51 Dan Carpenter [this message]
2022-10-12 15:43 ` [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check Julien Panis
2022-10-12 16:27 ` Vignesh Raghavendra
2022-10-13 0:50 ` William Breathitt Gray
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=Y0bUbZvfDJHBG9C6@kili \
--to=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=jpanis@baylibre.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=vigneshr@ti.com \
--cc=william.gray@linaro.org \
/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