From: Dan Carpenter <dan.carpenter@linaro.org>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dave Ertman <david.m.ertman@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Leon Romanovsky <leon@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH next] driver core: auxiliary bus: Fix IS_ERR() vs NULL check in __devm_auxiliary_device_create()
Date: Wed, 23 Apr 2025 11:17:51 +0300 [thread overview]
Message-ID: <aAiiLzqVulfGDPsl@stanley.mountain> (raw)
The auxiliary_device_create() function returns NULL. It doesn't return
error pointers. Update the checking to match.
Fixes: eaa0d30216c1 ("driver core: auxiliary bus: add device creation helpers")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/base/auxiliary.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
index 810b6105a75d..61b876d90b7f 100644
--- a/drivers/base/auxiliary.c
+++ b/drivers/base/auxiliary.c
@@ -491,8 +491,8 @@ struct auxiliary_device *__devm_auxiliary_device_create(struct device *dev,
int ret;
auxdev = auxiliary_device_create(dev, modname, devname, platform_data, id);
- if (IS_ERR(auxdev))
- return auxdev;
+ if (!auxdev)
+ return ERR_PTR(-ENOMEM);
ret = devm_add_action_or_reset(dev, auxiliary_device_destroy,
auxdev);
--
2.47.2
next reply other threads:[~2025-04-23 8:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 8:17 Dan Carpenter [this message]
2025-04-23 9:31 ` [PATCH next] driver core: auxiliary bus: Fix IS_ERR() vs NULL check in __devm_auxiliary_device_create() Jerome Brunet
2025-04-23 10:05 ` Dan Carpenter
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=aAiiLzqVulfGDPsl@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=dakr@kernel.org \
--cc=david.m.ertman@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=jbrunet@baylibre.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.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