From: Dan Carpenter Date: Wed, 9 Apr 2014 15:21:12 +0000 (+0300) Subject: drm/panel: s6e8aa0: silence array overflow warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9c911962f9d145fd6f8cb3d93ae58486cef14d53;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git drm/panel: s6e8aa0: silence array overflow warning 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 Acked-by: Andrzej Hajda Signed-off-by: Thierry Reding --- diff --git a/drivers/gpu/drm/panel/panel-s6e8aa0.c b/drivers/gpu/drm/panel/panel-s6e8aa0.c index 35941d2412b8..06e57a26db7a 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];