Commit ba403242 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Linus Walleij
Browse files

pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in...


pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()'

Use 'devm_of_iomap()' instead 'of_iomap()' to avoid a resource leak in
case of error.

Update the error handling code accordingly.

Fixes: 26d8cde5 ("pinctrl: freescale: imx: add shared input select reg support")
Suggested-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200602200626.677981-1-christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 11d8da5c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -824,12 +824,13 @@ int imx_pinctrl_probe(struct platform_device *pdev,
				return -EINVAL;
			}

			ipctl->input_sel_base = of_iomap(np, 0);
			ipctl->input_sel_base = devm_of_iomap(&pdev->dev, np,
							      0, NULL);
			of_node_put(np);
			if (!ipctl->input_sel_base) {
			if (IS_ERR(ipctl->input_sel_base)) {
				dev_err(&pdev->dev,
					"iomuxc input select base address not found\n");
				return -ENOMEM;
				return PTR_ERR(ipctl->input_sel_base);
			}
		}
	}