Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Gui-Dong Han <hanguidong02@outlook.com>,
	netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Simon Horman <horms@kernel.org>,
	Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: Jia-Ju Bai <baijiaju1990@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org
Subject: Re: [Intel-wired-lan] [PATCH v2] ice: Fix improper handling of refcount in ice_sriov_set_msix_vec_count()
Date: Sat, 7 Sep 2024 14:40:10 +0200	[thread overview]
Message-ID: <99a2d643-9004-41c8-8585-6c5c86fab599@web.de> (raw)
In-Reply-To: <SY8P300MB0460D0263B2105307C444520C0932@SY8P300MB0460.AUSP300.PROD.OUTLOOK.COM>

…
> +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
> @@ -1096,8 +1096,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
>  		return -ENOENT;
>
>  	vsi = ice_get_vf_vsi(vf);
> -	if (!vsi)
> +	if (!vsi) {
> +		ice_put_vf(vf);
>  		return -ENOENT;
> +	}
>
>  	prev_msix = vf->num_msix;
>  	prev_queues = vf->num_vf_qs;
> @@ -1142,8 +1144,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
>  	vf->num_msix = prev_msix;
>  	vf->num_vf_qs = prev_queues;
>  	vf->first_vector_idx = ice_sriov_get_irqs(pf, vf->num_msix);
> -	if (vf->first_vector_idx < 0)
> +	if (vf->first_vector_idx < 0) {
> +		ice_put_vf(vf);
>  		return -EINVAL;
> +	}
>
>  	if (needs_rebuild) {
>  		ice_vf_reconfig_vsi(vf);

Would you like to collaborate with any goto chains according to
the desired completion of exception handling?

Regards,
Markus

  parent reply	other threads:[~2024-09-07 12:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 11:59 [Intel-wired-lan] [PATCH v2] ice: Fix improper handling of refcount in ice_sriov_set_msix_vec_count() Gui-Dong Han
2024-09-06  8:30 ` Simon Horman
2024-09-07 12:40 ` Markus Elfring [this message]
2024-09-07 13:52   ` Simon Horman
2024-09-07 14:13   ` Greg KH
2024-09-09 14:16     ` Romanowski, Rafal

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=99a2d643-9004-41c8-8585-6c5c86fab599@web.de \
    --to=markus.elfring@web.de \
    --cc=anthony.l.nguyen@intel.com \
    --cc=baijiaju1990@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hanguidong02@outlook.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=stable@vger.kernel.org \
    /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