summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAishwarya Pant <aishpant@gmail.com>2017-03-12 21:10:07 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-14 07:57:53 +0800
commit0adbfd4694c2b2ae2f48b04295eadafed70612ad (patch)
treef1092231083658a1bfc48dce617fe1d1aefab753
parente3173e5783ffdf3aa7bcc8ac0a150b17d83c1792 (diff)
staging: bcm2835-audio: fix memory leak in bcm2835_audio_open_connection()
In bcm2835_audio_open_connection(), if VCHI connection fails or initialisation of VCHI audio instance fails vchi_instance needs to be deallocated otherwise it will cause a memory leak. 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.c1
1 files changed, 1 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 af16d0f3e2b3..6e007db9d694 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c
@@ -446,6 +446,7 @@ static int bcm2835_audio_open_connection(struct bcm2835_alsa_stream *alsa_stream
LOG_DBG(" success !\n");
ret = 0;
err_free_mem:
+ kfree(vchi_instance);
LOG_DBG(" .. OUT\n");
return ret;