From: Dan Carpenter <dan.carpenter@oracle.com>
To: hans.verkuil@cisco.com, m.chehab@samsung.com,
ext-eero.nurkkala@nokia.com, nils.faerber@kernelconcepts.de,
joni.lapilainen@gmail.com, freemangordon@abv.bg, sre@ring0.de,
pali.rohar@gmail.com, Greg KH <greg@kroah.com>,
trivial@kernel.org, linux-media@vger.kernel.org
Cc: kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH v3] [media] radio-bcm2048: fix wrong overflow check
Date: Tue, 22 Apr 2014 18:02:39 +0300 [thread overview]
Message-ID: <20140422150239.GA32637@mwanda> (raw)
In-Reply-To: <20140422125726.GA30238@mwanda>
From: Pali Rohár <pali.rohar@gmail.com>
This patch fixes an off by one check in bcm2048_set_region().
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: Send it to the correct list. Re-work the changelog.
v3: Correct subsystem prefix.
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index b2cd3a8..bbf236e 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -737,7 +737,7 @@ static int bcm2048_set_region(struct bcm2048_device *bdev, u8 region)
int err;
u32 new_frequency = 0;
- if (region > ARRAY_SIZE(region_configs))
+ if (region >= ARRAY_SIZE(region_configs))
return -EINVAL;
mutex_lock(&bdev->mutex);
--
next prev parent reply other threads:[~2014-04-22 15:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-20 14:56 [PATCH] radio-bcm2048.c: fix wrong overflow check Pavel Machek
2014-04-22 8:39 ` Dan Carpenter
2014-04-22 8:55 ` Pali Rohár
2014-04-22 9:16 ` Dan Carpenter
2014-04-22 9:38 ` Pavel Machek
2014-04-22 9:47 ` Pali Rohár
2014-04-22 12:57 ` [PATCH v2] " Dan Carpenter
2014-04-22 15:02 ` Dan Carpenter [this message]
2014-05-05 13:34 ` Jiri Kosina
2014-05-09 16:10 ` Pali Rohár
2014-05-09 17:13 ` Hans Verkuil
2014-05-11 21:06 ` Jiri Kosina
2014-04-22 13:02 ` [PATCH] " Dan Carpenter
2014-04-22 16:41 ` Greg KH
2014-04-22 10:06 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140422150239.GA32637@mwanda \
--to=dan.carpenter@oracle.com \
--cc=ext-eero.nurkkala@nokia.com \
--cc=freemangordon@abv.bg \
--cc=greg@kroah.com \
--cc=hans.verkuil@cisco.com \
--cc=joni.lapilainen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=nils.faerber@kernelconcepts.de \
--cc=pali.rohar@gmail.com \
--cc=sre@ring0.de \
--cc=trivial@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox