From fe6e87a4b570d2e435709746ba550a7197016bd0 Mon Sep 17 00:00:00 2001 From: David Vrabel Date: Fri, 12 Dec 2008 13:25:21 +0000 Subject: 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 --- drivers/usb/wusbcore/reservation.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/usb/wusbcore') diff --git a/drivers/usb/wusbcore/reservation.c b/drivers/usb/wusbcore/reservation.c index c37e4f83e54a..4ed97360c046 100644 --- a/drivers/usb/wusbcore/reservation.c +++ b/drivers/usb/wusbcore/reservation.c @@ -110,6 +110,9 @@ int wusbhc_rsv_establish(struct wusbhc *wusbhc) */ void wusbhc_rsv_terminate(struct wusbhc *wusbhc) { - uwb_rsv_terminate(wusbhc->rsv); - uwb_rsv_destroy(wusbhc->rsv); + if (wusbhc->rsv) { + uwb_rsv_terminate(wusbhc->rsv); + uwb_rsv_destroy(wusbhc->rsv); + wusbhc->rsv = NULL; + } } -- cgit v1.2.3-58-ga151