]> www.infradead.org Git - users/dwmw2/linux.git/commit
usb: typec: tcpm: remove tcpm dir if no children
authorLi Jun <jun.li@nxp.com>
Wed, 17 Jul 2019 08:06:46 +0000 (16:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:10:57 +0000 (10:10 +0200)
commit4f5f21cfe59a8401bfb6e18e03a6a112b431e282
tree4f67363004345644e1b96041230b714265ce5374
parentba2bf3bad73b3e54a1ec07c7bea159e11f61c6fa
usb: typec: tcpm: remove tcpm dir if no children

commit 12ca7297b8855c0af1848503d37196159b24e6b9 upstream.

If config tcpm as module, module unload will not remove tcpm dir,
then the next module load will have problem: the rootdir is NULL
but tcpm dir is still there, so tcpm_debugfs_init() will create
tcpm dir again with failure, fix it by remove the tcpm dir if no
children.

Cc: stable@vger.kernel.org # v4.15+
Fixes: 4b4e02c83167 ("typec: tcpm: Move out of staging")
Signed-off-by: Li Jun <jun.li@nxp.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20190717080646.30421-2-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c