Re: [PATCH v2] ALSA: pcm: fix multiple memory leak bugs

2019-08-07 Thread Wenwen Wang
On Wed, Aug 7, 2019 at 3:18 AM Takashi Iwai wrote: > > On Wed, 07 Aug 2019 09:09:59 +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]'. In > > hiface_pcm_init_urb(),

Re: [PATCH v2] ALSA: pcm: fix multiple memory leak bugs

2019-08-07 Thread Takashi Iwai
On Wed, 07 Aug 2019 09:09:59 +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]'. In > hiface_pcm_init_urb(), 'rt->out_urbs[i].buffer' is allocated through > kzalloc().

[PATCH v2] ALSA: pcm: fix multiple memory leak bugs

2019-08-07 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]'. In hiface_pcm_init_urb(), 'rt->out_urbs[i].buffer' is allocated through kzalloc(). However, if hiface_pcm_init_urb() fails, both 'rt' and