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

Commit e3173e57 authored by Aishwarya Pant's avatar Aishwarya Pant Committed by Greg Kroah-Hartman
Browse files

staging: bcm2835-audio: deallocate work when queue_work(...) fails



This patch de-allocates work when queue_work(..) fails in the
bcm2835-audio work functions

Signed-off-by: default avatarAishwarya Pant <aishpant@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8f1fff07
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ int bcm2835_audio_start(struct bcm2835_alsa_stream *alsa_stream)
		work->alsa_stream = alsa_stream;
		work->cmd = BCM2835_AUDIO_START;
		if (!queue_work(alsa_stream->my_wq, &work->my_work)) {
			kfree(work);
			return -EBUSY;
		}
	}
@@ -168,6 +169,7 @@ int bcm2835_audio_stop(struct bcm2835_alsa_stream *alsa_stream)
		work->alsa_stream = alsa_stream;
		work->cmd = BCM2835_AUDIO_STOP;
		if (!queue_work(alsa_stream->my_wq, &work->my_work)) {
			kfree(work);
			return -EBUSY;
		}
	}
@@ -194,6 +196,7 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream,
		work->src = src;
		work->count = count;
		if (!queue_work(alsa_stream->my_wq, &work->my_work)) {
			kfree(work);
			return -EBUSY;
		}
	}