public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] drm/panel: s6e8aa0: silence array overflow warning
@ 2014-04-09 15:21 Dan Carpenter
  2014-04-10  5:48 ` Andrzej Hajda
  2014-05-02 11:21 ` Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2014-04-09 15:21 UTC (permalink / raw)
  To: Thierry Reding, Andrzej Hajda
  Cc: Grant Likely, Rob Herring, kernel-janitors, dri-devel

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>
---
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];

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-02 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-09 15:21 [patch] drm/panel: s6e8aa0: silence array overflow warning Dan Carpenter
2014-04-10  5:48 ` Andrzej Hajda
2014-05-02 11:21 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox