Message ID | 20220916020854.4089679-1-windhl@126.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] ARM: OMAP2+: Hold reference returned from of_find_xxx API | expand |
diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index d4dab041324d..d56b33187244 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c @@ -213,10 +213,13 @@ static struct omap_voltdm_pmic omap4_core_pmic = { int __init omap4_twl_init(void) { struct voltagedomain *voltdm; + struct device_node *np = NULL; if (!cpu_is_omap44xx() || - of_find_compatible_node(NULL, NULL, "motorola,cpcap")) + (np = of_find_compatible_node(NULL, NULL, "motorola,cpcap"))) { + of_node_put(np); return -ENODEV; + } voltdm = voltdm_lookup("mpu"); omap_voltage_register_pmic(voltdm, &omap4_mpu_pmic);