From: Sukadev Bhattiprolu Date: Wed, 20 Dec 2017 01:10:29 +0000 (-0800) Subject: powerpc/powernv/vas: Fix order of cleanup in vas_window_init_dbgdir() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1373cc31074dff09419d616c2ce911eea624cff5;p=openwrt%2Fstaging%2Fblogic.git powerpc/powernv/vas: Fix order of cleanup in vas_window_init_dbgdir() Fix the order of cleanup to ensure we free the name buffer in case of an error creating 'hvwc' or 'info' files. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Michael Ellerman --- diff --git a/arch/powerpc/platforms/powernv/vas-debug.c b/arch/powerpc/platforms/powernv/vas-debug.c index ca22f1eae050..b4de4c6fd38b 100644 --- a/arch/powerpc/platforms/powernv/vas-debug.c +++ b/arch/powerpc/platforms/powernv/vas-debug.c @@ -166,13 +166,13 @@ void vas_window_init_dbgdir(struct vas_window *window) return; -free_name: - kfree(window->dbgname); - window->dbgname = NULL; - remove_dir: debugfs_remove_recursive(window->dbgdir); window->dbgdir = NULL; + +free_name: + kfree(window->dbgname); + window->dbgname = NULL; } void vas_instance_init_dbgdir(struct vas_instance *vinst)