Re: [PATCH] firestream: fix memory leaks

From: David Miller
Date: Sat Jan 25 2020 - 02:11:33 EST


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.

Thank you.