Re: [PATCH] ALSA: pcm: fix a memory leak bug

2019-08-06 Thread Wenwen Wang
On Wed, Aug 7, 2019 at 2:33 AM Takashi Iwai wrote: > > On Wed, 07 Aug 2019 08:15:17 +0200, > Wenwen Wang wrote: > > > > In hiface_pcm_init(), 'rt' is firstly allocated through kzalloc(). Later > > on, hiface_pcm_init_urb() is invoked to initialize 'rt->out_urbs[i]'. > > However, if the initializat

Re: [PATCH] ALSA: pcm: fix a memory leak bug

2019-08-06 Thread Takashi Iwai
On Wed, 07 Aug 2019 08:15:17 +0200, Wenwen Wang wrote: > > In hiface_pcm_init(), 'rt' is firstly allocated through kzalloc(). Later > on, hiface_pcm_init_urb() is invoked to initialize 'rt->out_urbs[i]'. > However, if the initialization fails, 'rt' is not deallocated, leading to a > memory leak bu

[PATCH] ALSA: pcm: fix a memory leak bug

2019-08-06 Thread Wenwen Wang
In hiface_pcm_init(), 'rt' is firstly allocated through kzalloc(). Later on, hiface_pcm_init_urb() is invoked to initialize 'rt->out_urbs[i]'. However, if the initialization fails, 'rt' is not deallocated, leading to a memory leak bug. To fix the above issue, free 'rt' before returning the error.