[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20170314075501.GB6022@mwanda>
Date: Tue, 14 Mar 2017 10:55:01 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alan Cox <alan@...ux.intel.com>, linux-media@...r.kernel.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH] staging: atomisp: silence an array overflow warning
Static checkers complain that we should check if "i" is in bounds
before we check if "var8[i]" is a NUL char. This bug is harmless but
also easy to fix.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
diff --git a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c
index 65513cae93ce..1dd061f00cd9 100644
--- a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c
@@ -669,7 +669,7 @@ int gmin_get_config_var(struct device *dev, const char *var, char *out, size_t *
/* Our variable names are ASCII by construction, but EFI names
* are wide chars. Convert and zero-pad. */
memset(var16, 0, sizeof(var16));
- for (i=0; var8[i] && i < sizeof(var8); i++)
+ for (i = 0; i < sizeof(var8) && var8[i]; i++)
var16[i] = var8[i];
/* To avoid owerflows when calling the efivar API */
Powered by blists - more mailing lists