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 v2 next] driver core: auxiliary bus: Fix IS_ERR() vs NULL mixup in __devm_auxiliary_device_create()
Date: Wed, 23 Apr 2025 13:04:26 +0300 [thread overview]
Message-ID: <aAi7Kg3aTguFD0fU@stanley.mountain> (raw)
This code was originally going to use error pointers but we decided it
should return NULL instead. The error pointer code in
__devm_auxiliary_device_create() was left over from the first version.
Update it to use NULL. No callers have been merged yet, so that makes
this change simple and self contained.
Fixes: eaa0d30216c1 ("driver core: auxiliary bus: add device creation helpers")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
v2: Originally I just updated the check for auxiliary_device_create()
failure and returned ERR_PTR(-ENOMEM) but obviously the
auxiliary_device_create() and devm_auxiliary_device_create()
functions should return the same thing, NULL.
drivers/base/auxiliary.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
index 810b6105a75d..dba7c8e13a53 100644
--- a/drivers/base/auxiliary.c
+++ b/drivers/base/auxiliary.c
@@ -491,13 +491,13 @@ 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 NULL;
ret = devm_add_action_or_reset(dev, auxiliary_device_destroy,
auxdev);
if (ret)
- return ERR_PTR(ret);
+ return NULL;
return auxdev;
}
--
2.47.2
next reply other threads:[~2025-04-23 10:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 10:04 Dan Carpenter [this message]
2025-04-23 13:17 ` [PATCH v2 next] driver core: auxiliary bus: Fix IS_ERR() vs NULL mixup in __devm_auxiliary_device_create() Jerome Brunet
2025-04-23 13:26 ` Leon Romanovsky
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=aAi7Kg3aTguFD0fU@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 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.