Re: [PATCH] firestream: fix memory leaks

From: Wenwen Wang
Date: Sat Jan 25 2020 - 09:34:55 EST


On Sat, Jan 25, 2020 at 2:11 AM David Miller <davem@xxxxxxxxxxxxx> wrote:
>
> From: Wenwen Wang <wenwen@xxxxxxxxxx>
> Date: Sat, 25 Jan 2020 05:11:34 +0000
>
> > @@ -922,6 +923,7 @@ static int fs_open(struct atm_vcc *atm_vcc)
> > if (((DO_DIRECTION(rxtp) && dev->atm_vccs[vcc->channo])) ||
> > ( DO_DIRECTION(txtp) && test_bit (vcc->channo, dev->tx_inuse))) {
> > printk ("Channel is in use for FS155.\n");
> > + kfree(vcc);
> > return -EBUSY;
> > }
> > }
> > --
>
> There is another case just below this line:
>
> tc, sizeof (struct fs_transmit_config));
> if (!tc) {
> fs_dprintk (FS_DEBUG_OPEN, "fs: can't alloc transmit_config.\n");
> return -ENOMEM;
> }
>
> Please audit the entire function and make sure your patch fixes all of these
> missing vcc free cases.

Thanks for your comment! I was planning to submit another patch as
this case has different semantics. But, since you have pointed out, I
will revise this patch.

Wenwen

>
> Thank you.