Re: [PATCH] fsi: master-gpio: Fix reference count leak in probe error path

From: Markus Elfring

Date: Mon Dec 08 2025 - 10:12:22 EST



> Add the missing of_node_put() in the error handling path to properly
> release the device tree node reference.

> +++ b/drivers/fsi/fsi-master-gpio.c
> @@ -861,6 +861,7 @@ static int fsi_master_gpio_probe(struct platform_device *pdev)
> }
> return 0;
> err_free:
> + of_node_put(master->master.dev.of_node);

Is there a need to rename the label accordingly?


> kfree(master);

Can it be helpful to move the statement “rc = PTR_ERR(gpio);”
also into the exception handling of this function implementation?


> return rc;
> }



Regards,
Markus