coresight: coresight_unregister() function cleanup
authorMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 2 Feb 2016 21:13:57 +0000 (14:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 06:11:10 +0000 (22:11 -0800)
commitfae54158792aec705620bdc3938d342879204f0c
tree60526b16e8c3c78cefcf772e5dd5e1bafd191c5f
parenta9ddc71f5840c2711e530f2e055b278f79948b29
coresight: coresight_unregister() function cleanup

In its current form the code never frees csdev->refcnt allocated
in coresight_register().  There is also a problem with csdev->conns
that is freed before device_unregister() rather than in the device
release function.

This patch addresses both issues by moving kfree(csdev->conns) to
coresight_device_release() and freeing csdev->refcnt, also in
the same function.

Reported-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight.c