From: Aishwarya Pant Date: Sun, 12 Mar 2017 15:40:07 +0000 (+0530) Subject: staging: bcm2835-audio: fix memory leak in bcm2835_audio_open_connection() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0adbfd4694c2b2ae2f48b04295eadafed70612ad;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Greg Kroah-Hartman --- 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;