提交 ee65e182 编写于 作者: D Dan Carpenter 提交者: Tomi Valkeinen

fb: adv7393: off by one in probe function

This should be >= instead of >.  It's a little bit clearer if we just
get rid of the temporary variable and just use ARRAY_SIZE() directly.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
上级 d4b9efa3
......@@ -375,7 +375,6 @@ static int bfin_adv7393_fb_probe(struct i2c_client *client,
{
int ret = 0;
struct proc_dir_entry *entry;
int num_modes = ARRAY_SIZE(known_modes);
struct adv7393fb_device *fbdev = NULL;
......@@ -384,7 +383,7 @@ static int bfin_adv7393_fb_probe(struct i2c_client *client,
return -EINVAL;
}
if (mode > num_modes) {
if (mode >= ARRAY_SIZE(known_modes)) {
dev_err(&client->dev, "mode %d: not supported", mode);
return -EFAULT;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册