Skip to content

Commit

Permalink
drm/panel: s6e8aa0: silence array overflow warning
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
Dan Carpenter authored and Thierry Reding committed Jun 5, 2014
1 parent d162180 commit 9c91196
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/panel/panel-s6e8aa0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 9c91196

Please sign in to comment.