Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee788d2f authored by edwardkao(153792)'s avatar edwardkao(153792) Committed by Gerrit Code Review
Browse files

Merge "ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in...

Merge "ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in card.c" into 8901-fairphone-p-mp-release
parents 8f1ac4d6 876177b0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -742,9 +742,12 @@ static int usb_audio_probe(struct usb_interface *intf,

 __error:
	if (chip) {
		/* chip->active is inside the chip->card object,
		 * decrement before memory is possibly returned.
		 */
		atomic_dec(&chip->active);
		if (!chip->num_interfaces)
			snd_card_free(chip->card);
		atomic_dec(&chip->active);
	}
	mutex_unlock(&register_mutex);
	return err;