]> git.baikalelectronics.ru Git - kernel.git/commit
ppdev: don't print a free'd string
authorColin Ian King <colin.king@canonical.com>
Fri, 2 Dec 2016 16:23:55 +0000 (16:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jan 2017 08:14:19 +0000 (09:14 +0100)
commite6478afda3f8f40bef302db090595a44cabdc06d
tree13a8718095bdd9da919dad07249210b2f414f118
parentc53e2d797ba56840de2a15e6085199381ecffeab
ppdev: don't print a free'd string

A previous fix of a memory leak now prints the string 'name'
that was previously free'd.  Fix this by free'ing the string
at the end of the function and adding an error exit path for
the error conditions.

CoverityScan CID#1384523 ("Use after free")

Fixes: 6ac5d045aa6c5 ("ppdev: fix memory leak")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/ppdev.c