Message ID | 20240605073827.3380584-1-yangyingliang@huawei.com |
---|---|
Headers | show |
Series | pinctrl: fix possible memory leak when pinctrl_enable() fails | expand |
On Wed, Jun 05, 2024 at 03:38:26PM +0800, Yang Yingliang wrote: > @@ -1879,7 +1878,7 @@ static int pcs_probe(struct platform_device *pdev) > if (ret < 0) > goto free; > > - ret = pinctrl_register_and_init(&pcs->desc, pcs->dev, pcs, &pcs->pctl); > + ret = devm_pinctrl_register_and_init(pcs->dev, &pcs->desc, pcs, &pcs->pctl); > if (ret) { > dev_err(pcs->dev, "could not register single pinctrl driver\n"); > goto free; Could you add a check in this function for if pinctrl_enable() fails? regards, dan carpenter