Commit fe6e87a4b570d2e435709746ba550a7197016bd0
1 parent
671e470ed0
Exists in
master
and in
7 other branches
wusb: fix oops when terminating a non-existant reservation
If a reservation was not established, do not try terminating it. Signed-off-by: David Vrabel <david.vrabel@csr.com>
Showing 1 changed file with 5 additions and 2 deletions Side-by-side Diff
drivers/usb/wusbcore/reservation.c
... | ... | @@ -110,7 +110,10 @@ |
110 | 110 | */ |
111 | 111 | void wusbhc_rsv_terminate(struct wusbhc *wusbhc) |
112 | 112 | { |
113 | - uwb_rsv_terminate(wusbhc->rsv); | |
114 | - uwb_rsv_destroy(wusbhc->rsv); | |
113 | + if (wusbhc->rsv) { | |
114 | + uwb_rsv_terminate(wusbhc->rsv); | |
115 | + uwb_rsv_destroy(wusbhc->rsv); | |
116 | + wusbhc->rsv = NULL; | |
117 | + } | |
115 | 118 | } |