From: Andrzej Hajda <a.hajda@samsung.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Thierry Reding <thierry.reding@gmail.com>
Cc: David Airlie <airlied@linux.ie>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] drm/panel: s6e8aa0: silence array overflow warning
Date: Thu, 10 Apr 2014 05:48:37 +0000 [thread overview]
Message-ID: <534630B5.2080705@samsung.com> (raw)
In-Reply-To: <20140409152112.GD24536@mwanda>
Hi Dan,
Thanks for the patch.
On 04/09/2014 05:21 PM, Dan Carpenter wrote:
> Smatch complains that we are reading beyond the end of the array here:
>
> drivers/gpu/drm/panel/panel-s6e8aa0.c:852 s6e8aa0_read_mtp_id()
> warn: buffer overflow 's6e8aa0_variants' 4 <= 4
>
> We set the error code, so it's not harmful but it looks like a return
> was intended here so lets add that and silence the warning.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
> Compile tested only.
>
> diff --git a/drivers/gpu/drm/panel/panel-s6e8aa0.c b/drivers/gpu/drm/panel/panel-s6e8aa0.c
> index 35941d2..06e57a2 100644
> --- a/drivers/gpu/drm/panel/panel-s6e8aa0.c
> +++ b/drivers/gpu/drm/panel/panel-s6e8aa0.c
> @@ -847,6 +847,7 @@ static void s6e8aa0_read_mtp_id(struct s6e8aa0 *ctx)
> if (i >= ARRAY_SIZE(s6e8aa0_variants)) {
> dev_err(ctx->dev, "unsupported display version %d\n", id[1]);
> ctx->error = -EINVAL;
> + return;
> }
>
> ctx->variant = &s6e8aa0_variants[i];
>
next prev parent reply other threads:[~2014-04-10 5:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 15:21 [patch] drm/panel: s6e8aa0: silence array overflow warning Dan Carpenter
2014-04-10 5:48 ` Andrzej Hajda [this message]
2014-05-02 11:21 ` Thierry Reding
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=534630B5.2080705@samsung.com \
--to=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=grant.likely@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=thierry.reding@gmail.com \
/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