* [PATCH] lm8333: Fix check ordering
@ 2012-06-27 11:02 Alan Cox
2012-06-27 15:36 ` Jiri Kosina
0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2012-06-27 11:02 UTC (permalink / raw)
To: trivial, linux-input
From: Alan Cox <alan@linux.intel.com>
Fix harmless reference off end of array
Reported-by: <dcb314@hotmail.com>
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?43861
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/input/keyboard/lm8333.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c
index ca168a6..081fd9e 100644
--- a/drivers/input/keyboard/lm8333.c
+++ b/drivers/input/keyboard/lm8333.c
@@ -91,7 +91,7 @@ static void lm8333_key_handler(struct lm8333 *lm8333)
return;
}
- for (i = 0; keys[i] && i < LM8333_FIFO_TRANSFER_SIZE; i++) {
+ for (i = 0; i < LM8333_FIFO_TRANSFER_SIZE && keys[i]; i++) {
pressed = keys[i] & 0x80;
code = keys[i] & 0x7f;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] lm8333: Fix check ordering
2012-06-27 11:02 Alan Cox
@ 2012-06-27 15:36 ` Jiri Kosina
0 siblings, 0 replies; 5+ messages in thread
From: Jiri Kosina @ 2012-06-27 15:36 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-input
On Wed, 27 Jun 2012, Alan Cox wrote:
> From: Alan Cox <alan@linux.intel.com>
>
> Fix harmless reference off end of array
>
> Reported-by: <dcb314@hotmail.com>
> Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?43861
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
>
> drivers/input/keyboard/lm8333.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c
> index ca168a6..081fd9e 100644
> --- a/drivers/input/keyboard/lm8333.c
> +++ b/drivers/input/keyboard/lm8333.c
> @@ -91,7 +91,7 @@ static void lm8333_key_handler(struct lm8333 *lm8333)
> return;
> }
>
> - for (i = 0; keys[i] && i < LM8333_FIFO_TRANSFER_SIZE; i++) {
> + for (i = 0; i < LM8333_FIFO_TRANSFER_SIZE && keys[i]; i++) {
> pressed = keys[i] & 0x80;
> code = keys[i] & 0x7f;
>
Applied to trivial, thanks Alan.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] lm8333: Fix check ordering
@ 2012-07-04 14:57 Alan Cox
2012-07-04 20:05 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2012-07-04 14:57 UTC (permalink / raw)
To: linux-input, linux-kernel, dmitry.torokhov
From: Alan Cox <alan@linux.intel.com>
Fix harmless reference off end of array
Reported-by: <dcb314@hotmail.com>
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?43861
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/input/keyboard/lm8333.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c
index ca168a6..081fd9e 100644
--- a/drivers/input/keyboard/lm8333.c
+++ b/drivers/input/keyboard/lm8333.c
@@ -91,7 +91,7 @@ static void lm8333_key_handler(struct lm8333 *lm8333)
return;
}
- for (i = 0; keys[i] && i < LM8333_FIFO_TRANSFER_SIZE; i++) {
+ for (i = 0; i < LM8333_FIFO_TRANSFER_SIZE && keys[i]; i++) {
pressed = keys[i] & 0x80;
code = keys[i] & 0x7f;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] lm8333: Fix check ordering
2012-07-04 14:57 [PATCH] lm8333: Fix check ordering Alan Cox
@ 2012-07-04 20:05 ` Dmitry Torokhov
2012-07-04 21:45 ` Jiri Kosina
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2012-07-04 20:05 UTC (permalink / raw)
To: Alan Cox; +Cc: linux-input, linux-kernel, Jiri Kosina
Hi Alan,
On Wed, Jul 04, 2012 at 03:57:00PM +0100, Alan Cox wrote:
> From: Alan Cox <alan@linux.intel.com>
>
> Fix harmless reference off end of array
>
> Reported-by: <dcb314@hotmail.com>
> Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?43861
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
>
> drivers/input/keyboard/lm8333.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c
> index ca168a6..081fd9e 100644
> --- a/drivers/input/keyboard/lm8333.c
> +++ b/drivers/input/keyboard/lm8333.c
> @@ -91,7 +91,7 @@ static void lm8333_key_handler(struct lm8333 *lm8333)
> return;
> }
>
> - for (i = 0; keys[i] && i < LM8333_FIFO_TRANSFER_SIZE; i++) {
> + for (i = 0; i < LM8333_FIFO_TRANSFER_SIZE && keys[i]; i++) {
> pressed = keys[i] & 0x80;
> code = keys[i] & 0x7f;
>
>
I believe Jiri has already queued this through trivial tree...
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] lm8333: Fix check ordering
2012-07-04 20:05 ` Dmitry Torokhov
@ 2012-07-04 21:45 ` Jiri Kosina
0 siblings, 0 replies; 5+ messages in thread
From: Jiri Kosina @ 2012-07-04 21:45 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: Alan Cox, linux-input, linux-kernel
On Wed, 4 Jul 2012, Dmitry Torokhov wrote:
> > From: Alan Cox <alan@linux.intel.com>
> >
> > Fix harmless reference off end of array
> >
> > Reported-by: <dcb314@hotmail.com>
> > Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?43861
> > Signed-off-by: Alan Cox <alan@linux.intel.com>
> > ---
> >
> > drivers/input/keyboard/lm8333.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c
> > index ca168a6..081fd9e 100644
> > --- a/drivers/input/keyboard/lm8333.c
> > +++ b/drivers/input/keyboard/lm8333.c
> > @@ -91,7 +91,7 @@ static void lm8333_key_handler(struct lm8333 *lm8333)
> > return;
> > }
> >
> > - for (i = 0; keys[i] && i < LM8333_FIFO_TRANSFER_SIZE; i++) {
> > + for (i = 0; i < LM8333_FIFO_TRANSFER_SIZE && keys[i]; i++) {
> > pressed = keys[i] & 0x80;
> > code = keys[i] & 0x7f;
> >
> >
>
> I believe Jiri has already queued this through trivial tree...
Yup, it's in -next as 954bd6d1c. Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-07-04 21:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-04 14:57 [PATCH] lm8333: Fix check ordering Alan Cox
2012-07-04 20:05 ` Dmitry Torokhov
2012-07-04 21:45 ` Jiri Kosina
-- strict thread matches above, loose matches on Subject: below --
2012-06-27 11:02 Alan Cox
2012-06-27 15:36 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).