diff options
author | David Vrabel <david.vrabel@csr.com> | 2008-10-27 11:22:46 -0400 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2008-10-28 08:07:23 -0400 |
commit | cae1c11414912bf77a62aebd65ced321f0b9da51 (patch) | |
tree | 1f83b9b82aec7f86740f8b1f7f5e8be1c6cf3196 /drivers/usb | |
parent | b09ac64b7b2d93efab3998033588f5cb0e470ccf (diff) |
uwb: reference count reservations
Reference counting the struct uwb_rsv's is safer and easier to get right than
the transferring ownership of the structures from the PAL to reservation
manager.
This fixes an oops in the debug PAL after a reservation timed out.
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/wusbcore/reservation.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/wusbcore/reservation.c b/drivers/usb/wusbcore/reservation.c index fc63e77ded2d..7b6525dac2f1 100644 --- a/drivers/usb/wusbcore/reservation.c +++ b/drivers/usb/wusbcore/reservation.c | |||
@@ -59,7 +59,6 @@ static void wusbhc_rsv_complete_cb(struct uwb_rsv *rsv) | |||
59 | case UWB_RSV_STATE_NONE: | 59 | case UWB_RSV_STATE_NONE: |
60 | dev_dbg(dev, "removed reservation\n"); | 60 | dev_dbg(dev, "removed reservation\n"); |
61 | wusbhc_bwa_set(wusbhc, 0, NULL); | 61 | wusbhc_bwa_set(wusbhc, 0, NULL); |
62 | wusbhc->rsv = NULL; | ||
63 | break; | 62 | break; |
64 | default: | 63 | default: |
65 | dev_dbg(dev, "unexpected reservation state: %d\n", rsv->state); | 64 | dev_dbg(dev, "unexpected reservation state: %d\n", rsv->state); |
@@ -105,11 +104,11 @@ int wusbhc_rsv_establish(struct wusbhc *wusbhc) | |||
105 | 104 | ||
106 | 105 | ||
107 | /** | 106 | /** |
108 | * wusbhc_rsv_terminate - terminate any cluster reservation | 107 | * wusbhc_rsv_terminate - terminate the cluster reservation |
109 | * @wusbhc: the WUSB host whose reservation is to be terminated | 108 | * @wusbhc: the WUSB host whose reservation is to be terminated |
110 | */ | 109 | */ |
111 | void wusbhc_rsv_terminate(struct wusbhc *wusbhc) | 110 | void wusbhc_rsv_terminate(struct wusbhc *wusbhc) |
112 | { | 111 | { |
113 | if (wusbhc->rsv) | 112 | uwb_rsv_terminate(wusbhc->rsv); |
114 | uwb_rsv_terminate(wusbhc->rsv); | 113 | uwb_rsv_destroy(wusbhc->rsv); |
115 | } | 114 | } |