mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
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,
	dan.carpenter@oracle.com, pali.rohar@gmail.com,
	Greg KH <greg@kroah.com>,
	trivial@kernel.org
Cc: kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] radio-bcm2048.c: fix wrong overflow check
Date: Sun, 20 Apr 2014 16:56:22 +0200	[thread overview]
Message-ID: <20140420145622.GA15567@amd.pavel.ucw.cz> (raw)


Fix wrong overflow check in radio-bcm2048.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>


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);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

             reply	other threads:[~2014-04-20 14:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-20 14:56 Pavel Machek [this message]
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             ` [PATCH v3] [media] radio-bcm2048: " Dan Carpenter
2014-05-05 13:34             ` [PATCH v2] radio-bcm2048.c: " 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=20140420145622.GA15567@amd.pavel.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=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=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

all inboxes | Powered by JetHome®