w1: omap_hdq: Free resources on error path
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 9 Jan 2017 00:13:00 +0000 (01:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Jan 2017 10:46:42 +0000 (11:46 +0100)
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 <christophe.jaillet@wanadoo.fr>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/masters/omap_hdq.c

index bb09de633939222e7f47d1b11908ab09aba0e79b..fb190c2596070eb7042de766198462f69c3cca96 100644 (file)
@@ -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);