Skip to content

Commit fe6e87a

Browse files
author
David Vrabel
committed
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>
1 parent 671e470 commit fe6e87a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎drivers/usb/wusbcore/reservation.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ int wusbhc_rsv_establish(struct wusbhc *wusbhc)
110110
*/
111111
void wusbhc_rsv_terminate(struct wusbhc *wusbhc)
112112
{
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+
}
115118
}

0 commit comments

Comments
 (0)