diff options
author | Ming Lei <tom.leiming@gmail.com> | 2011-01-04 07:21:32 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-22 21:32:55 -0500 |
commit | 20831ad23978d0543b0b23128621b6d8ee7757f1 (patch) | |
tree | f8da021c6e5e05e71067c757c060525284d76448 /drivers/usb/otg/nop-usb-xceiv.c | |
parent | 0cdfb819b6a97e79c7a0aa0c471cd7000367103b (diff) |
usb: otg: nop: fix oops triggered by otg_register_notifier
This patch adds BLOCKING_INIT_NOTIFIER_HEAD in nop_usb_xceiv_probe,
so that we can avoid oops caused by uninitialized
nop->otg.notifier.rwsem which will be touched in otg_register_notifier
path.
Reported-by: Gupta, Ajay Kumar <ajay.gupta@ti.com>
Tested-by: Gupta, Ajay Kumar <ajay.gupta@ti.com>
Cc: Balbi, Felipe <balbi@ti.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/otg/nop-usb-xceiv.c')
-rw-r--r-- | drivers/usb/otg/nop-usb-xceiv.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index e70014ab0976..8acf165fe13b 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c | |||
@@ -132,6 +132,8 @@ static int __devinit nop_usb_xceiv_probe(struct platform_device *pdev) | |||
132 | 132 | ||
133 | platform_set_drvdata(pdev, nop); | 133 | platform_set_drvdata(pdev, nop); |
134 | 134 | ||
135 | BLOCKING_INIT_NOTIFIER_HEAD(&nop->otg.notifier); | ||
136 | |||
135 | return 0; | 137 | return 0; |
136 | exit: | 138 | exit: |
137 | kfree(nop); | 139 | kfree(nop); |