kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: David Airlie <airlied@linux.ie>, Heiko Stuebner <heiko@sntech.de>,
	dri-devel@lists.freedesktop.org,
	linux-rockchip@lists.infradead.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] drm/rockchip: fix a couple off by one bugs
Date: Thu, 14 Jul 2016 02:22:23 +0000	[thread overview]
Message-ID: <5786F75F.30703@rock-chips.com> (raw)
In-Reply-To: <20160713101504.GJ29468@mwanda>

On 2016年07月13日 18:15, Dan Carpenter wrote:
> The priv->crtc_funcs[] array has ROCKCHIP_MAX_CRTC elements so > should
> be >= here.
>
> Fixes: 2048e3286f34 ('drm: rockchip: Add basic drm driver')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks for the fix, applied to my drm-fixes.

> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> index 7fd20c0..37ca427 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> @@ -79,7 +79,7 @@ int rockchip_register_crtc_funcs(struct drm_crtc *crtc,
>   	int pipe = drm_crtc_index(crtc);
>   	struct rockchip_drm_private *priv = crtc->dev->dev_private;
>   
> -	if (pipe > ROCKCHIP_MAX_CRTC)
> +	if (pipe >= ROCKCHIP_MAX_CRTC)
>   		return -EINVAL;
>   
>   	priv->crtc_funcs[pipe] = crtc_funcs;
> @@ -92,7 +92,7 @@ void rockchip_unregister_crtc_funcs(struct drm_crtc *crtc)
>   	int pipe = drm_crtc_index(crtc);
>   	struct rockchip_drm_private *priv = crtc->dev->dev_private;
>   
> -	if (pipe > ROCKCHIP_MAX_CRTC)
> +	if (pipe >= ROCKCHIP_MAX_CRTC)
>   		return;
>   
>   	priv->crtc_funcs[pipe] = NULL;
>
>
>


-- 
Mark Yao



      parent reply	other threads:[~2016-07-14  2:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-13 10:15 [patch] drm/rockchip: fix a couple off by one bugs Dan Carpenter
2016-07-13 15:38 ` Sean Paul
2016-07-14  2:22 ` Mark yao [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=5786F75F.30703@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=airlied@linux.ie \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.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).