staging: fwserial: Switch to kfree_rcu() API
authorShang XiaoJing <shangxiaojing@huawei.com>
Tue, 20 Sep 2022 13:51:45 +0000 (21:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2022 10:55:22 +0000 (12:55 +0200)
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>
drivers/staging/fwserial/fwserial.c

index e8fa7f5..3134b13 100644 (file)
@@ -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);
 }
 
 /**