提交 0adbfd46 编写于 作者: A Aishwarya Pant 提交者: Greg Kroah-Hartman

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: NAishwarya Pant <aishpant@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 e3173e57
...@@ -446,6 +446,7 @@ static int bcm2835_audio_open_connection(struct bcm2835_alsa_stream *alsa_stream ...@@ -446,6 +446,7 @@ static int bcm2835_audio_open_connection(struct bcm2835_alsa_stream *alsa_stream
LOG_DBG(" success !\n"); LOG_DBG(" success !\n");
ret = 0; ret = 0;
err_free_mem: err_free_mem:
kfree(vchi_instance);
LOG_DBG(" .. OUT\n"); LOG_DBG(" .. OUT\n");
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册