Source
203
203
EXPORT_SYMBOL(fw_iso_resources_update);
204
204
205
205
/**
206
206
* fw_iso_resources_free - frees allocated resources
207
207
* @r: the resource manager
208
208
*
209
209
* This function deallocates the channel and bandwidth, if allocated.
210
210
*/
211
211
void fw_iso_resources_free(struct fw_iso_resources *r)
212
212
{
213
-
struct fw_card *card = fw_parent_device(r->unit)->card;
213
+
struct fw_card *card;
214
214
int bandwidth, channel;
215
215
216
+
/* Not initialized. */
217
+
if (r->unit == NULL)
218
+
return;
219
+
card = fw_parent_device(r->unit)->card;
220
+
216
221
mutex_lock(&r->mutex);
217
222
218
223
if (r->allocated) {
219
224
bandwidth = r->bandwidth + r->bandwidth_overhead;
220
225
fw_iso_resource_manage(card, r->generation, 1uLL << r->channel,
221
226
&channel, &bandwidth, false);
222
227
if (channel < 0)
223
228
dev_err(&r->unit->device,
224
229
"isochronous resource deallocation failed\n");
225
230