diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-07-15 14:08:17 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-08-30 12:06:12 +0300 |
commit | ee65e18206f5b430d71c39f72fa85a8d1f2b999d (patch) | |
tree | 05b5685bad8e765e1e522635aac9f31667440491 /drivers/video/fbdev | |
parent | d4b9efa3b9aa7d4c0e946ecb634154132402158f (diff) | |
download | linux-ee65e18206f5b430d71c39f72fa85a8d1f2b999d.tar.bz2 |
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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r-- | drivers/video/fbdev/bfin_adv7393fb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/video/fbdev/bfin_adv7393fb.c b/drivers/video/fbdev/bfin_adv7393fb.c index 2b7cd30df31b..542ffaddc6ab 100644 --- a/drivers/video/fbdev/bfin_adv7393fb.c +++ b/drivers/video/fbdev/bfin_adv7393fb.c @@ -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; } |