2011-07-27 20:55:31

by Łukasz Stelmach

[permalink] [raw]
Subject: [PATCH] Fix off-by-one error in form factor detection.

The keywords we are looking for are at odd positions.

Signed-off-by: Łukasz Stelmach <[email protected]>
---
plugins/formfactor.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plugins/formfactor.c b/plugins/formfactor.c
index 758d481..33a8b32 100644
--- a/plugins/formfactor.c
+++ b/plugins/formfactor.c
@@ -104,7 +104,7 @@ static int formfactor_probe(struct btd_adapter *adapter)
return 0;
}

- formfactor = chassis_map[chassis_type * 2];
+ formfactor = chassis_map[chassis_type * 2 + 1];
if (formfactor != NULL) {
if (g_str_equal(formfactor, "laptop") == TRUE)
minor |= (1 << 2) | (1 << 3);
--
1.7.3.4


----------------------------------------------------------------
Najwieksza baza samochodow nowych i uzywanych
Sprawdz >> http://linkint.pl/f29e3


2011-07-29 10:13:11

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Fix off-by-one error in form factor detection.

Hi Lukasz,

On Wed, Jul 27, 2011, Łukasz Stelmach wrote:
> The keywords we are looking for are at odd positions.
> ---
> plugins/formfactor.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Applied. Thanks.

Johan