From: Dan Carpenter Date: Sat, 1 Nov 2025 13:27:07 +0000 (+0300) Subject: reset: rzg2l-usbphy-ctrl: Fix a NULL vs IS_ERR() bug in probe X-Git-Tag: v6.19-rc1~98^2~1^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cea5d43b63b221522f8532a7894149f3d8d11f4b;p=thirdparty%2Flinux.git reset: rzg2l-usbphy-ctrl: Fix a NULL vs IS_ERR() bug in probe The devm_regmap_field_alloc() function never returns NULL, it returns error pointers. Update the error checking to match. Fixes: 58128aa88867 ("reset: rzg2l-usbphy-ctrl: Add support for USB PWRRDY") Signed-off-by: Dan Carpenter Reviewed-by: Claudiu Beznea Signed-off-by: Philipp Zabel --- diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-rzg2l-usbphy-ctrl.c index eea56687cd0a3..4ecb9acb26418 100644 --- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c +++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c @@ -158,8 +158,8 @@ static int rzg2l_usbphy_ctrl_pwrrdy_init(struct device *dev) field.msb = __fls(args[1]); pwrrdy = devm_regmap_field_alloc(dev, regmap, field); - if (!pwrrdy) - return -ENOMEM; + if (IS_ERR(pwrrdy)) + return PTR_ERR(pwrrdy); rzg2l_usbphy_ctrl_set_pwrrdy(pwrrdy, true);