linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] w1: omap_hdq: Free resources on error path
@ 2017-01-09  0:13 Christophe JAILLET
  2017-01-24  2:03 ` Evgeniy Polyakov
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2017-01-09  0:13 UTC (permalink / raw)
  To: zbr; +Cc: linux-kernel, kernel-janitors, Christophe JAILLET

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>
---
 drivers/w1/masters/omap_hdq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index bb09de633939..fb190c259607 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);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] w1: omap_hdq: Free resources on error path
  2017-01-09  0:13 [PATCH] w1: omap_hdq: Free resources on error path Christophe JAILLET
@ 2017-01-24  2:03 ` Evgeniy Polyakov
  0 siblings, 0 replies; 2+ messages in thread
From: Evgeniy Polyakov @ 2017-01-24  2:03 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: linux-kernel, kernel-janitors

Hi Christophe

09.01.2017, 03:13, "Christophe JAILLET" <christophe.jaillet@wanadoo.fr>:
> 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>

Looks good to me.
If kernel-janitors@ will not push it upstream feel free to send to to GregKH <greg@kroah.com>
and add me to copy.

Acked-by: Evgeniy Polyakov <zbr@ioremap.net>

> ---
>  drivers/w1/masters/omap_hdq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
> index bb09de633939..fb190c259607 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);
> --
> 2.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-24  2:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-09  0:13 [PATCH] w1: omap_hdq: Free resources on error path Christophe JAILLET
2017-01-24  2:03 ` Evgeniy Polyakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).