From: Christophe JAILLET Date: Mon, 9 Jan 2017 00:13:00 +0000 (+0100) Subject: w1: omap_hdq: Free resources on error path X-Git-Tag: v4.11-rc1~118^2~91 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8333eb153a9fd86028abd0942c6aec0705764410;p=thirdparty%2Fkernel%2Flinux.git w1: omap_hdq: Free resources on error path In case of error returned by '_omap_hdq_reset()', free resources as done elsewhere in this function. This patch slighly changes the semantic of the code. It now propagates the error code returned by '_omap_hdq_reset()' instead of returning -EINVAL unconditionally. Signed-off-by: Christophe JAILLET Acked-by: Evgeniy Polyakov Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c index bb09de6339392..fb190c2596070 100644 --- a/drivers/w1/masters/omap_hdq.c +++ b/drivers/w1/masters/omap_hdq.c @@ -715,7 +715,7 @@ static int omap_hdq_probe(struct platform_device *pdev) ret = _omap_hdq_reset(hdq_data); if (ret) { dev_dbg(&pdev->dev, "reset failed\n"); - return -EINVAL; + goto err_irq; } rev = hdq_reg_in(hdq_data, OMAP_HDQ_REVISION);