|
@@ -682,9 +682,12 @@ static int usb_audio_probe(struct usb_interface *intf,
|
|
|
|
|
|
__error:
|
|
__error:
|
|
if (chip) {
|
|
if (chip) {
|
|
|
|
+ /* chip->active is inside the chip->card object,
|
|
|
|
+ * decrement before memory is possibly returned.
|
|
|
|
+ */
|
|
|
|
+ atomic_dec(&chip->active);
|
|
if (!chip->num_interfaces)
|
|
if (!chip->num_interfaces)
|
|
snd_card_free(chip->card);
|
|
snd_card_free(chip->card);
|
|
- atomic_dec(&chip->active);
|
|
|
|
}
|
|
}
|
|
mutex_unlock(®ister_mutex);
|
|
mutex_unlock(®ister_mutex);
|
|
return err;
|
|
return err;
|