Repository navigation
Commit eb1b482
dwc_otg: prevent OOPSes during device disconnects
The dwc_otg_urb_enqueue function is thread-unsafe. In particular the
access of urb->hcpriv, usb_hcd_link_urb_to_ep, dwc_otg_urb->qtd and
friends does not occur within a critical section and so if a device
was unplugged during activity there was a high chance that the
usbcore hub_thread would try to disable the endpoint with partially-
formed entries in the URB queue. This would result in BUG() or null
pointer dereferences.
Fix so that access of urb->hcpriv, enqueuing to the hardware and
adding to usbcore endpoint URB lists is contained within a single
critical section.1 parent e66eaac commit eb1b482
3 files changed
Lines changed: 6 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
468 | 467 | | |
469 | 468 | | |
470 | 469 | | |
| |||
515 | 514 | | |
516 | 515 | | |
517 | 516 | | |
518 | | - | |
519 | 517 | | |
520 | 518 | | |
521 | 519 | | |
522 | 520 | | |
523 | | - | |
524 | 521 | | |
525 | 522 | | |
526 | 523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | | - | |
683 | 682 | | |
684 | | - | |
685 | 683 | | |
686 | 684 | | |
687 | 685 | | |
| |||
733 | 731 | | |
734 | 732 | | |
735 | 733 | | |
736 | | - | |
737 | 734 | | |
738 | 735 | | |
739 | 736 | | |
| |||
775 | 772 | | |
776 | 773 | | |
777 | 774 | | |
778 | | - | |
779 | 775 | | |
| 776 | + | |
| 777 | + | |
780 | 778 | | |
781 | | - | |
782 | 779 | | |
783 | 780 | | |
784 | 781 | | |
| |||
794 | 791 | | |
795 | 792 | | |
796 | 793 | | |
797 | | - | |
798 | | - | |
799 | 794 | | |
800 | | - | |
| 795 | + | |
801 | 796 | | |
802 | | - | |
803 | 797 | | |
| 798 | + | |
804 | 799 | | |
805 | 800 | | |
806 | 801 | | |
807 | 802 | | |
| 803 | + | |
808 | 804 | | |
809 | 805 | | |
810 | 806 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
| 922 | + | |
922 | 923 | | |
923 | 924 | | |
924 | 925 | | |
| |||
931 | 932 | | |
932 | 933 | | |
933 | 934 | | |
934 | | - | |
935 | | - | |
936 | 935 | | |
937 | 936 | | |
938 | 937 | | |
| |||
946 | 945 | | |
947 | 946 | | |
948 | 947 | | |
949 | | - | |
950 | 948 | | |
951 | 949 | | |
952 | 950 | | |
953 | 951 | | |
954 | 952 | | |
955 | 953 | | |
956 | | - | |
957 | | - | |
958 | 954 | | |
959 | 955 | | |
960 | 956 | | |
| |||
0 commit comments