From: Shang XiaoJing <shangxiaojing@huawei.com>
Date: Tue, 20 Sep 2022 13:51:45 +0000 (+0800)
Subject: staging: fwserial: Switch to kfree_rcu() API
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=74adc1f005e6c28f9019ae49cb5f2796e532f25e;p=linux.git

staging: fwserial: Switch to kfree_rcu() API

Instead of invoking a synchronize_rcu() to free a pointer after a grace
period, we can directly make use of a new API that does the same but in
a more efficient way.

Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Link: https://lore.kernel.org/r/20220920135145.1387-1-shangxiaojing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index e8fa7f53cd5ee..3134b13081af5 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -2116,8 +2116,7 @@ static void fwserial_remove_peer(struct fwtty_peer *peer)
 	if (port)
 		fwserial_release_port(port, true);
 
-	synchronize_rcu();
-	kfree(peer);
+	kfree_rcu(peer);
 }
 
 /**