Netdev List
 help / color / mirror / Atom feed
From: Ayush Yaduvanshi <ayush37735@gmail.com>
To: anthony.l.nguyen@intel.com
Cc: przemyslaw.kitszel@intel.com, intel-wired-lan@lists.osuosl.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ayush Yaduvanshi <ayush37735@gmail.com>
Subject: [PATCH] net: intel: ice: Modernize ice_vsi_free() with scope-based guard(mutex)
Date: Wed, 14 Oct 2026 16:35:52 +0530	[thread overview]
Message-ID: <20261014110552.56976-1-ayush37735@gmail.com> (raw)

Signed-off-by: Ayush Yaduvanshi <ayush37735@gmail.com>
---
 drivers/net/ethernet/intel/ice/ice_lib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 9e08db376d3d..c695df442822 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -457,7 +457,7 @@ void ice_vsi_free(struct ice_vsi *vsi)
 		return;
 	}
 
-	mutex_lock(&pf->sw_mutex);
+	guard(mutex)(&pf->sw_mutex);
 	/* updates the PF for this cleared VSI */
 
 	pf->vsi[vsi->idx] = NULL;
@@ -466,7 +466,6 @@ void ice_vsi_free(struct ice_vsi *vsi)
 	ice_vsi_free_stats(vsi);
 	ice_vsi_free_arrays(vsi);
 	mutex_destroy(&vsi->xdp_state_lock);
-	mutex_unlock(&pf->sw_mutex);
 	devm_kfree(dev, vsi);
 }
 
-- 
2.53.0


             reply	other threads:[~2026-10-14 11:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 11:05 Ayush Yaduvanshi [this message]
2026-10-14 16:36 ` [PATCH] net: intel: ice: Modernize ice_vsi_free() with scope-based guard(mutex) Kohei Enju
2026-10-14 20:22   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261014110552.56976-1-ayush37735@gmail.com \
    --to=ayush37735@gmail.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox