[v2,02/14] misc: vmw_vmci: Rename kvfree_rcu() to kvfree_rcu_mightsleep()

Message ID 20230315181902.4177819-2-joel@joelfernandes.org
State New
Headers
Series [v2,01/14] drbd: Rename kvfree_rcu() to kvfree_rcu_mightsleep() |

Commit Message

Joel Fernandes March 15, 2023, 6:18 p.m. UTC
  From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>

The kvfree_rcu() macro's single-argument form is deprecated.  Therefore
switch to the new kvfree_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.

Cc: Bryan Tan <bryantan@vmware.com>
Cc: Vishnu Dasa <vdasa@vmware.com>
Reviewed-by: Vishnu Dasa <vdasa@vmware.com>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
 drivers/misc/vmw_vmci/vmci_context.c | 2 +-
 drivers/misc/vmw_vmci/vmci_event.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Greg KH March 16, 2023, 6:50 a.m. UTC | #1
On Wed, Mar 15, 2023 at 06:18:49PM +0000, Joel Fernandes (Google) wrote:
> From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
> 
> The kvfree_rcu() macro's single-argument form is deprecated.  Therefore
> switch to the new kvfree_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.
> 
> Cc: Bryan Tan <bryantan@vmware.com>
> Cc: Vishnu Dasa <vdasa@vmware.com>
> Reviewed-by: Vishnu Dasa <vdasa@vmware.com>
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> ---
>  drivers/misc/vmw_vmci/vmci_context.c | 2 +-
>  drivers/misc/vmw_vmci/vmci_event.c   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  
Joel Fernandes March 16, 2023, 3:21 p.m. UTC | #2
On Thu, Mar 16, 2023 at 2:50 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Mar 15, 2023 at 06:18:49PM +0000, Joel Fernandes (Google) wrote:
> > From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
> >
> > The kvfree_rcu() macro's single-argument form is deprecated.  Therefore
> > switch to the new kvfree_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.
> >
> > Cc: Bryan Tan <bryantan@vmware.com>
> > Cc: Vishnu Dasa <vdasa@vmware.com>
> > Reviewed-by: Vishnu Dasa <vdasa@vmware.com>
> > Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> > Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
> > ---
> >  drivers/misc/vmw_vmci/vmci_context.c | 2 +-
> >  drivers/misc/vmw_vmci/vmci_event.c   | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Thanks!

- Joel
  

Patch

diff --git a/drivers/misc/vmw_vmci/vmci_context.c b/drivers/misc/vmw_vmci/vmci_context.c
index 172696abce31..f22b44827e92 100644
--- a/drivers/misc/vmw_vmci/vmci_context.c
+++ b/drivers/misc/vmw_vmci/vmci_context.c
@@ -687,7 +687,7 @@  int vmci_ctx_remove_notification(u32 context_id, u32 remote_cid)
 	spin_unlock(&context->lock);
 
 	if (notifier)
-		kvfree_rcu(notifier);
+		kvfree_rcu_mightsleep(notifier);
 
 	vmci_ctx_put(context);
 
diff --git a/drivers/misc/vmw_vmci/vmci_event.c b/drivers/misc/vmw_vmci/vmci_event.c
index 2100297c94ad..5d7ac07623c2 100644
--- a/drivers/misc/vmw_vmci/vmci_event.c
+++ b/drivers/misc/vmw_vmci/vmci_event.c
@@ -209,7 +209,7 @@  int vmci_event_unsubscribe(u32 sub_id)
 	if (!s)
 		return VMCI_ERROR_NOT_FOUND;
 
-	kvfree_rcu(s);
+	kvfree_rcu_mightsleep(s);
 
 	return VMCI_SUCCESS;
 }