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-next>] [day] [month] [year] [list]
Date:	Wed, 26 Jun 2013 10:19:10 +0900
From:	jonghwa3.lee@...sung.com
To:	Chanwoo Choi <cw00.choi@...sung.com>
Cc:	Anton Vorontsov <anton.vorontsov@...aro.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Myungjoo Ham <myungjoo.ham@...sung.com>
Subject: Re: [PATCH 2/2] power: charger-manager: Fix a bug when it unregisters
 notifier block of extcon.

Hi,
On 2013년 06월 25일 22:34, Chanwoo Choi wrote:

> On Tue, Jun 25, 2013 at 2:02 PM, Jonghwa Lee <jonghwa3.lee@...sung.com
> <mailto:jonghwa3.lee@...sung.com>> wrote:
> 
>     This patch prevents NULL pointer error cauesed by unregistering unregistered
>     exton notifier block. At the probing time of charger manager, it tries to
>     remove extcon notifier block when it fails to initialize them. It has to be
>     applied for only registered one. Otherwise, it'd make kernel panic. To make it
>     work right, it checks extcon_specific_cable_nb's extcon_dev node. If extcon
>     cable notifier block was registered successfully, it has proper extcon_dev
>     pointer if not so it has NULL pointer.
> 
>     Signed-off-by: Jonghwa Lee <jonghwa3.lee@...sung.com
>     <mailto:jonghwa3.lee@...sung.com>>
>     Signed-off-by: Myungjoo Ham <myungjoo.ham@...sung.com
>     <mailto:myungjoo.ham@...sung.com>>
>     ---
>      drivers/power/charger-manager.c |    4 +++-
>      1 file changed, 3 insertions(+), 1 deletion(-)
> 
>     diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
>     index 7d1bcde..c55a7dc 100644
>     --- a/drivers/power/charger-manager.c
>     +++ b/drivers/power/charger-manager.c
>     @@ -1666,7 +1666,9 @@ err_reg_extcon:
>                     charger = &desc->charger_regulators[i];
>                     for (j = 0; j < charger->num_cables; j++) {
>                             struct charger_cable *cable = &charger->cables[j];
>     -                       extcon_unregister_interest(&cable->extcon_dev);
>     +                       /* Remove notifier block if only edev exists */
>     +                       if (cable->extcon_dev.edev)
>     +                               extcon_unregister_interest(&cable->extcon_dev);
>                     }
> 
>                     regulator_put(desc->charger_regulators[i].consumer);
>     --
>     1.7.9.5
> 
> 
> The charger-manager.c call extcon_unregister_interest() in
> charger_manager_remove() function.
> So, you should to fix it on charger_manager_remove() to remove NULL pointer error.
> 


When .remove() callback function is called, there is no unregistered cable
notifier block. Because all extcon notifier block would be registered at probing
time, and if it is failed the probing can't be achieved. So I think it doesn't
need to fix .remove() callback function as like above.

Thank you for reviewing.

Best regards,
Jonghwa.


> Acked-by: Chanwoo Choi <cw00.choi@...sung.com <mailto:cw00.choi@...sung.com>>
> 
> 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