From: Dan Carpenter Date: Wed, 23 Apr 2025 10:04:26 +0000 (+0300) Subject: driver core: auxiliary bus: Fix IS_ERR() vs NULL mixup in __devm_auxiliary_device_cre... X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2806c6b8f3d1e406f2b7e3266ddd21100fbe7151;p=users%2Fwilly%2Flinux.git driver core: auxiliary bus: Fix IS_ERR() vs NULL mixup in __devm_auxiliary_device_create() 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 Reviewed-by: Jerome Brunet Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/aAi7Kg3aTguFD0fU@stanley.mountain Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c index a6d46c2759be..fd7efd2c94e1 100644 --- a/drivers/base/auxiliary.c +++ b/drivers/base/auxiliary.c @@ -481,13 +481,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; }