Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac802154: Rename kfree_rcu() to kvfree_rcu_mightsleep()

The k[v]free_rcu() macro's single-argument form is deprecated.
Therefore switch to the new k[v]free_rcu_mightsleep() variant. The goal
is to avoid accidental use of the single-argument forms, which can
introduce functionality bugs in atomic contexts and latency bugs in
non-atomic contexts.

The callers are holding a mutex so the context allows blocking. Hence
using the API with a single argument will be fine, but use its new name.

There is no functionality change with this patch.

Fixes: 57588c71177f ("mac802154: Handle passive scanning")
Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>

+2 -2
+2 -2
net/mac802154/scan.c
··· 52 52 request = rcu_replace_pointer(local->scan_req, NULL, 1); 53 53 if (!request) 54 54 return 0; 55 - kfree_rcu(request); 55 + kvfree_rcu_mightsleep(request); 56 56 57 57 /* Advertize first, while we know the devices cannot be removed */ 58 58 if (aborted) ··· 403 403 request = rcu_replace_pointer(local->beacon_req, NULL, 1); 404 404 if (!request) 405 405 return 0; 406 - kfree_rcu(request); 406 + kvfree_rcu_mightsleep(request); 407 407 408 408 nl802154_beaconing_done(wpan_dev); 409 409