File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -572,6 +572,7 @@ static int init_vudc_hw(struct vudc *udc)
572
572
init_waitqueue_head (& udc -> tx_waitq );
573
573
574
574
spin_lock_init (& ud -> lock );
575
+ mutex_init (& ud -> sysfs_lock );
575
576
ud -> status = SDEV_ST_AVAILABLE ;
576
577
ud -> side = USBIP_VUDC ;
577
578
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ static ssize_t usbip_sockfd_store(struct device *dev,
112
112
dev_err (dev , "no device" );
113
113
return - ENODEV ;
114
114
}
115
+ mutex_lock (& udc -> ud .sysfs_lock );
115
116
spin_lock_irqsave (& udc -> lock , flags );
116
117
/* Don't export what we don't have */
117
118
if (!udc -> driver || !udc -> pullup ) {
@@ -187,6 +188,8 @@ static ssize_t usbip_sockfd_store(struct device *dev,
187
188
188
189
wake_up_process (udc -> ud .tcp_rx );
189
190
wake_up_process (udc -> ud .tcp_tx );
191
+
192
+ mutex_unlock (& udc -> ud .sysfs_lock );
190
193
return count ;
191
194
192
195
} else {
@@ -207,6 +210,7 @@ static ssize_t usbip_sockfd_store(struct device *dev,
207
210
}
208
211
209
212
spin_unlock_irqrestore (& udc -> lock , flags );
213
+ mutex_unlock (& udc -> ud .sysfs_lock );
210
214
211
215
return count ;
212
216
@@ -216,6 +220,7 @@ static ssize_t usbip_sockfd_store(struct device *dev,
216
220
spin_unlock_irq (& udc -> ud .lock );
217
221
unlock :
218
222
spin_unlock_irqrestore (& udc -> lock , flags );
223
+ mutex_unlock (& udc -> ud .sysfs_lock );
219
224
220
225
return ret ;
221
226
}
You can’t perform that action at this time.
0 commit comments