Skip to content

Commit 0adbfd4

Browse files
aishpantgregkh
authored andcommitted
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>
1 parent e3173e5 commit 0adbfd4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ static int bcm2835_audio_open_connection(struct bcm2835_alsa_stream *alsa_stream
446446
LOG_DBG(" success !\n");
447447
ret = 0;
448448
err_free_mem:
449+
kfree(vchi_instance);
449450
LOG_DBG(" .. OUT\n");
450451

451452
return ret;

0 commit comments

Comments
 (0)