public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Engestrom <eric@engestrom.ch>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [patch] drm/vc4: fix a bounds check
Date: Mon, 16 Jan 2017 23:40:10 +0000	[thread overview]
Message-ID: <20170116234010.GA21894@engestrom.ch> (raw)
In-Reply-To: <20170113074900.GB30524@mwanda>

On Friday, 2017-01-13 10:49:00 +0300, Dan Carpenter wrote:
> We accidentally return success even if vc4_full_res_bounds_check() fails.
> 
> Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Not tested.

It would be good to test it, but the previous code would always return 0,
and from a quick look the callers expect non-zero values on error, so
this makes more sense at least.
Reviewed-by: Eric Engestrom <eric@engestrom.ch>

> 
> diff --git a/drivers/gpu/drm/vc4/vc4_render_cl.c b/drivers/gpu/drm/vc4/vc4_render_cl.c
> index 08886a3..5cdd003 100644
> --- a/drivers/gpu/drm/vc4/vc4_render_cl.c
> +++ b/drivers/gpu/drm/vc4/vc4_render_cl.c
> @@ -461,7 +461,7 @@ static int vc4_rcl_surface_setup(struct vc4_exec_info *exec,
>  		}
>  
>  		ret = vc4_full_res_bounds_check(exec, *obj, surf);
> -		if (!ret)
> +		if (ret)
>  			return ret;
>  
>  		return 0;

This now boils down to `return vc4_full_res_bounds_check(...);`, so you
could get rid of the `ret` variable completely :)

  reply	other threads:[~2017-01-16 23:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13  7:49 [patch] drm/vc4: fix a bounds check Dan Carpenter
2017-01-16 23:40 ` Eric Engestrom [this message]
2017-01-17  7:42   ` Dan Carpenter
2017-01-17 10:18 ` Eric Anholt

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=20170116234010.GA21894@engestrom.ch \
    --to=eric@engestrom.ch \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@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