All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Wei Yongjun <weiyongjun1@huawei.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
	Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH -next] PCI: endpoint: Fix missing unlock on error in pci_epf_add_vepf()
Date: Thu, 19 Aug 2021 18:07:58 +0530	[thread overview]
Message-ID: <b0e3a9b9-3a7b-6d17-aa5d-16001677aca7@ti.com> (raw)
In-Reply-To: <20210819080655.316468-1-weiyongjun1@huawei.com>

Hi Wei,

On 19/08/21 1:36 pm, Wei Yongjun wrote:
> Add the missing unlock before return from function pci_epf_add_vepf()
> in the error handling case.
> 
> Fixes: b64215ff2b5e ("PCI: endpoint: Add support to add virtual function in endpoint core")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Thanks for the patch. Since I had to resend the series, I squashed this
patch into the original series

https://lore.kernel.org/r/20210819123343.1951-3-kishon@ti.com

Thanks
Kishon

> ---
>  drivers/pci/endpoint/pci-epf-core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c
> index ec286ee5d04c..8aea16380870 100644
> --- a/drivers/pci/endpoint/pci-epf-core.c
> +++ b/drivers/pci/endpoint/pci-epf-core.c
> @@ -200,8 +200,10 @@ int pci_epf_add_vepf(struct pci_epf *epf_pf, struct pci_epf *epf_vf)
>  	mutex_lock(&epf_pf->lock);
>  	vfunc_no = find_first_zero_bit(&epf_pf->vfunction_num_map,
>  				       BITS_PER_LONG);
> -	if (vfunc_no >= BITS_PER_LONG)
> +	if (vfunc_no >= BITS_PER_LONG) {
> +		mutex_unlock(&epf_pf->lock);
>  		return -EINVAL;
> +	}
>  
>  	set_bit(vfunc_no, &epf_pf->vfunction_num_map);
>  	epf_vf->vfunc_no = vfunc_no;
> 

      reply	other threads:[~2021-08-19 12:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  8:06 [PATCH -next] PCI: endpoint: Fix missing unlock on error in pci_epf_add_vepf() Wei Yongjun
2021-08-19 12:37 ` Kishon Vijay Abraham I [this message]

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=b0e3a9b9-3a7b-6d17-aa5d-16001677aca7@ti.com \
    --to=kishon@ti.com \
    --cc=bhelgaas@google.com \
    --cc=hulkci@huawei.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=weiyongjun1@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.