diff options
author | Aishwarya Pant <aishpant@gmail.com> | 2017-03-12 21:09:49 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-14 07:57:53 +0800 |
commit | e3173e5783ffdf3aa7bcc8ac0a150b17d83c1792 (patch) | |
tree | a4212d2817043a7790d39d1150b00b1202770ad0 | |
parent | 8f1fff07b07fdb15d1d585f6eb1ea56e748bc637 (diff) |
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: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c index 6feb1a6b07d9..af16d0f3e2b3 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c @@ -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; } } |