[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1402c8bb-f5af-8a34-ee79-31c32eb26379@ti.com>
Date: Tue, 4 Jan 2022 14:33:26 +0530
From: Kishon Vijay Abraham I <kishon@...com>
To: Li Chen <lchen@...arella.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Krzysztof WilczyĆski <kw@...ux.com>
Subject: Re: [PATCH] PCI: endpoint: set_msi: return -EINVAL when interrupts
num is smaller than 1
On 21/12/21 8:29 am, Li Chen wrote:
> There is no sense to go further if we have no interrupts.
>
> Signed-off-by: Li Chen <lchen@...arella.com>
Reviewed-by: Kishon Vijay Abraham I <kishon@...com>
> ---
> drivers/pci/endpoint/pci-epc-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
> index 38621558d3975..3bc9273d0a082 100644
> --- a/drivers/pci/endpoint/pci-epc-core.c
> +++ b/drivers/pci/endpoint/pci-epc-core.c
> @@ -334,7 +334,7 @@ int pci_epc_set_msi(struct pci_epc *epc, u8 func_no, u8 vfunc_no, u8 interrupts)
> u8 encode_int;
>
> if (IS_ERR_OR_NULL(epc) || func_no >= epc->max_functions ||
> - interrupts > 32)
> + interrupts < 1 || interrupts > 32)
> return -EINVAL;
>
> if (vfunc_no > 0 && (!epc->max_vfs || vfunc_no > epc->max_vfs[func_no]))
>
Powered by blists - more mailing lists