staging: fwserial: fix resource leak
authorVladimirs Ambrosovs <rodriguez.twister@gmail.com>
Mon, 25 May 2015 20:22:44 +0000 (23:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 02:47:57 +0000 (11:47 +0900)
commit904998bf542309735f944387c158ceed84f6abc6
tree3cddb7dba8430213cb0da4beb760f84bf49b284e
parent71d667b800c53f840f516eb7d332186ffee3e84a
staging: fwserial: fix resource leak

This patch fixes the leak, which was present in fwserial driver in the
init function. In case the tty driver allocation failed the function
returned error, leaving debugfs entry in the filesystem.

To fix the issue additional error label was added, so that the code will
jump to it in case of allocation failure, and free debugfs entries.

Signed-off-by: Vladimirs Ambrosovs <rodriguez.twister@gmail.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fwserial/fwserial.c