]> git.baikalelectronics.ru Git - kernel.git/commit
staging: tidspbridge: fix bridge_open memory leaks
authorOmar Ramirez Luna <omar.ramirez@ti.com>
Tue, 31 Jan 2012 01:20:17 +0000 (19:20 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Feb 2012 22:14:14 +0000 (14:14 -0800)
commitfddeb168e5de6ca71cfff609fb99ad4e3d48855a
tree7870b43e0e1b5af040b6487fb85ae451768f9728
parentae796b666cc80990826f965b0ec9d2a89821584a
staging: tidspbridge: fix bridge_open memory leaks

There are two members of pr_ctxt allocated during bridge_open that
are never freed resulting in memory leaks, these are stream_id and
node_id, they are now freed on release of the handle (bridge_release)
right before freeing pr_ctxt.

Error path for bridge_open was also fixed since the same variables
could result in memory leaking due to missing handling of failure
scenarios. While at it, the indentation changes were introduced to
avoid interleaved goto statements inside big if blocks.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/tidspbridge/rmgr/drv_interface.c