linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: kernel-janitors@vger.kernel.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 09/11] Input: sur40: fix error return code
Date: Mon, 24 Aug 2015 12:30:31 -0700	[thread overview]
Message-ID: <20150824193031.GD22442@dtor-ws> (raw)
In-Reply-To: <1440288682-12732-10-git-send-email-Julia.Lawall@lip6.fr>

On Sun, Aug 23, 2015 at 02:11:20AM +0200, Julia Lawall wrote:
> Propagate error code on failure.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> identifier ret; expression e1,e2;
> @@
> (
> if (\(ret < 0\|ret != 0\))
>  { ... return ret; }
> |
> ret = 0
> )
> ... when != ret = e1
>     when != &ret
> *if(...)
> {
>   ... when != ret = e2
>       when forall
>  return ret;
> }
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied, thank you.

> 
> ---
>  drivers/input/touchscreen/sur40.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
> index 8be7b9b..3f11763 100644
> --- a/drivers/input/touchscreen/sur40.c
> +++ b/drivers/input/touchscreen/sur40.c
> @@ -581,6 +581,7 @@ static int sur40_probe(struct usb_interface *interface,
>  	sur40->alloc_ctx = vb2_dma_sg_init_ctx(sur40->dev);
>  	if (IS_ERR(sur40->alloc_ctx)) {
>  		dev_err(sur40->dev, "Can't allocate buffer context");
> +		error = PTR_ERR(sur40->alloc_ctx);
>  		goto err_unreg_v4l2;
>  	}
>  
> 

-- 
Dmitry

      reply	other threads:[~2015-08-24 19:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-23  0:11 [PATCH 00/11] fix error return code Julia Lawall
2015-08-23  0:11 ` [PATCH 09/11] Input: sur40: " Julia Lawall
2015-08-24 19:30   ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150824193031.GD22442@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).