From a7350f99bf238cd7b50f17ec62fdda941ce6f885 Mon Sep 17 00:00:00 2001 From: Carlos Llamas Date: Tue, 28 Jul 2026 19:27:39 +0000 Subject: [PATCH] ANDROID: xt_IDLETIMER: reorder idletimer_tg_destroy() The sysfs_remove_file() call in idletimer_tg_destroy() was incorrectly placed before cancel_work_sync() during a merge conflict resolution in commit 92cf99250dd3 ("Merge tag 'v6.2-rc1' into android-mainline"). Let's switch to the original order as introduced by commit 68983a354a65 ("netfilter: xtables: Add snapshot of hardidletimer target"). This aligns the order of the calls with upstream. Also move unregister_pm_notifier() calls before timer_shutdown_sync(). This aligns the order of the calls with older ACK branches. As having these differences across branches is creating confusion with partners. Bug: 497588852 Bug: 531493108 Fixes: 92cf99250dd3 ("Merge tag 'v6.2-rc1' into android-mainline") Change-Id: Ia65db132c22a487b1874e9b59da8e7c9ad3ac324 Signed-off-by: Carlos Llamas --- net/netfilter/xt_IDLETIMER.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c index 1c425b378f56..ff15d885d428 100644 --- a/net/netfilter/xt_IDLETIMER.c +++ b/net/netfilter/xt_IDLETIMER.c @@ -691,10 +691,10 @@ static void idletimer_tg_destroy(const struct xt_tgdtor_param *par) list_del(&info->timer->entry); mutex_unlock(&list_mutex); - timer_shutdown_sync(&info->timer->timer); - sysfs_remove_file(idletimer_tg_kobj, &info->timer->attr.attr); unregister_pm_notifier(&info->timer->pm_nb); + timer_shutdown_sync(&info->timer->timer); cancel_work_sync(&info->timer->work); + sysfs_remove_file(idletimer_tg_kobj, &info->timer->attr.attr); kfree(info->timer->attr.attr.name); kfree(info->timer); } @@ -719,14 +719,14 @@ static void idletimer_tg_destroy_v1(const struct xt_tgdtor_param *par) list_del(&info->timer->entry); mutex_unlock(&list_mutex); + unregister_pm_notifier(&info->timer->pm_nb); if (info->timer->timer_type & XT_IDLETIMER_ALARM) { alarm_cancel(&info->timer->alarm); } else { timer_shutdown_sync(&info->timer->timer); } - sysfs_remove_file(idletimer_tg_kobj, &info->timer->attr.attr); - unregister_pm_notifier(&info->timer->pm_nb); cancel_work_sync(&info->timer->work); + sysfs_remove_file(idletimer_tg_kobj, &info->timer->attr.attr); kfree(info->timer->attr.attr.name); kfree(info->timer); }