[PATCH 03/12] PowerPC-83xx: add missing of_node_put after of_device_is_available

Markus Elfring Markus.Elfring at web.de
Mon Apr 15 01:25:24 AEST 2019


> @@ -221,8 +221,10 @@ int mpc837x_usb_cfg(void)
>  	int ret = 0;
>
>  	np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
> -	if (!np || !of_device_is_available(np))
> +	if (!np || !of_device_is_available(np)) {
> +		of_node_put(np);
>  		return -ENODEV;
> +	}
>  	prop = of_get_property(np, "phy_type", NULL);
>
>  	if (!prop || (strcmp(prop, "ulpi") && strcmp(prop, "serial"))) {

How do you think about to adjust the exception handling in this function
implementation a bit more according to the Linux coding style?

Regards,
Markus


More information about the Linuxppc-dev mailing list