Commit 4cb4221
Felipe Balbi
usb: dwc3: gadget: fix for possible endpoint disable race
when we call dwc3_gadget_giveback(), we end up
releasing our controller's lock. Another thread
could get scheduled and disable the endpoint,
subsequently setting dep->endpoint.desc to NULL.
In that case, we would end up dereferencing a NULL
pointer which would result in a Kernel Oops. Let's
avoid the problem by simply returning early if we
have a NULL descriptor.
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>1 parent 9cad39f commit 4cb4221
1 file changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2041 | 2041 | | |
2042 | 2042 | | |
2043 | 2043 | | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
2044 | 2052 | | |
2045 | 2053 | | |
2046 | 2054 | | |
| |||
2078 | 2086 | | |
2079 | 2087 | | |
2080 | 2088 | | |
2081 | | - | |
| 2089 | + | |
2082 | 2090 | | |
2083 | 2091 | | |
2084 | 2092 | | |
| |||
2107 | 2115 | | |
2108 | 2116 | | |
2109 | 2117 | | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
2110 | 2126 | | |
2111 | 2127 | | |
2112 | 2128 | | |
| |||
0 commit comments