ppdev: fix memory leak
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Thu, 10 Nov 2016 22:11:59 +0000 (22:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Nov 2016 19:25:34 +0000 (20:25 +0100)
commit2bd362d5f45c17f3a41b3ab04e71508ffd3f48c5
tree911516ca1d0a07f183893ab4c0f29a3cf8827efc
parent9ff2007bea1f1bfc53ac0bc7ccf8200bb275fd52
ppdev: fix memory leak

The variable name was only released if parport_register_dev_model()
fails. Now that we are using the device-model the parport driver
will duplicate the name and use it. So we can release the variable
after the device has been registered with the parport.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/ppdev.c