* [PATCH] extcon: class: Add NULL pointer checking for removing notifier block.
@ 2013-06-14 2:11 Jonghwa Lee
2013-06-14 7:17 ` Chanwoo Choi
0 siblings, 1 reply; 2+ messages in thread
From: Jonghwa Lee @ 2013-06-14 2:11 UTC (permalink / raw)
To: linux-pm; +Cc: linux-kernel, MyungJoo Ham, Chanwoo Choi, Jonghwa Lee
This patch adds NULL pointer checking of extcon device to 'extcon_unregister
_interest' which unregisters extcon notifier block.
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
---
drivers/extcon/extcon-class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c
index 8c69803..23f11ea 100644
--- a/drivers/extcon/extcon-class.c
+++ b/drivers/extcon/extcon-class.c
@@ -491,7 +491,7 @@ EXPORT_SYMBOL_GPL(extcon_register_interest);
*/
int extcon_unregister_interest(struct extcon_specific_cable_nb *obj)
{
- if (!obj)
+ if (!obj || !obj->edev)
return -EINVAL;
return raw_notifier_chain_unregister(&obj->edev->nh, &obj->internal_nb);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] extcon: class: Add NULL pointer checking for removing notifier block.
2013-06-14 2:11 [PATCH] extcon: class: Add NULL pointer checking for removing notifier block Jonghwa Lee
@ 2013-06-14 7:17 ` Chanwoo Choi
0 siblings, 0 replies; 2+ messages in thread
From: Chanwoo Choi @ 2013-06-14 7:17 UTC (permalink / raw)
To: Jonghwa Lee; +Cc: linux-pm, linux-kernel, MyungJoo Ham
On 06/14/2013 11:11 AM, Jonghwa Lee wrote:
> This patch adds NULL pointer checking of extcon device to 'extcon_unregister
> _interest' which unregisters extcon notifier block.
>
> Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
> ---
> drivers/extcon/extcon-class.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c
> index 8c69803..23f11ea 100644
> --- a/drivers/extcon/extcon-class.c
> +++ b/drivers/extcon/extcon-class.c
> @@ -491,7 +491,7 @@ EXPORT_SYMBOL_GPL(extcon_register_interest);
> */
> int extcon_unregister_interest(struct extcon_specific_cable_nb *obj)
> {
> - if (!obj)
> + if (!obj || !obj->edev)
> return -EINVAL;
>
> return raw_notifier_chain_unregister(&obj->edev->nh, &obj->internal_nb);
>
Applied it.
Thanks,
Chanwoo Choi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-14 7:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-14 2:11 [PATCH] extcon: class: Add NULL pointer checking for removing notifier block Jonghwa Lee
2013-06-14 7:17 ` Chanwoo Choi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox