lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 03 Sep 2015 15:57:36 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	Hans de Goede <hdegoede@...hat.com>,
	MyungJoo Ham <myungjoo.ham@...sung.com>
Cc:	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] extcon: Fix attached value returned by is_extcon_changed

On 2015년 08월 24일 07:35, Hans de Goede wrote:
> is_extcon_changed should only check the idx-th bit of new, not
> the entirety of new when setting attached.
> 
> This fixes extcon sending notifications that a cable was inserted when
> it gets removed while another cable is still connected.
> 
> Cc: stable@...r.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@...hat.com>
> ---
>  drivers/extcon/extcon.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 43b57b0..c4698ce 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
>  static bool is_extcon_changed(u32 prev, u32 new, int idx, bool *attached)
>  {
>  	if (((prev >> idx) & 0x1) != ((new >> idx) & 0x1)) {
> -		*attached = new ? true : false;
> +		*attached = ((new >> idx) & 0x1) ? true : false;
>  		return true;
>  	}
>  
> 

Applied it.

Thanks,
Chanwoo Choi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ