Skip to content

Commit

Permalink
usb: otg: nop: fix oops triggered by otg_register_notifier
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ming Lei authored and Greg Kroah-Hartman committed Jan 23, 2011
1 parent 0cdfb81 commit 20831ad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/otg/nop-usb-xceiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ static int __devinit nop_usb_xceiv_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, nop);

BLOCKING_INIT_NOTIFIER_HEAD(&nop->otg.notifier);

return 0;
exit:
kfree(nop);
Expand Down

0 comments on commit 20831ad

Please sign in to comment.