* [PATCH 1/2] PCI: endpoint: Check correct variable in __pci_epf_mhi_alloc_map()
@ 2023-06-09 10:49 Dan Carpenter
2023-06-09 10:50 ` [PATCH 2/2] PCI: endpoint: Fix an IS_ERR() vs NULL bug Dan Carpenter
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dan Carpenter @ 2023-06-09 10:49 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
Kishon Vijay Abraham I, Bjorn Helgaas, Damien Le Moal, mhi,
linux-arm-msm, linux-pci, kernel-janitors
This was intended to check "*vaddr" instead of "vaddr" (without an
asterisk).
Fixes: 7db424a84d96 ("PCI: endpoint: Add PCI Endpoint function driver for MHI bus")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/pci/endpoint/functions/pci-epf-mhi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
index 1227f059ea12..e7d64b9d12ff 100644
--- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
+++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
@@ -112,7 +112,7 @@ static int __pci_epf_mhi_alloc_map(struct mhi_ep_cntrl *mhi_cntrl, u64 pci_addr,
int ret;
*vaddr = pci_epc_mem_alloc_addr(epc, paddr, size + offset);
- if (!vaddr)
+ if (!*vaddr)
return -ENOMEM;
ret = pci_epc_map_addr(epc, epf->func_no, epf->vfunc_no, *paddr,
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] PCI: endpoint: Fix an IS_ERR() vs NULL bug
2023-06-09 10:49 [PATCH 1/2] PCI: endpoint: Check correct variable in __pci_epf_mhi_alloc_map() Dan Carpenter
@ 2023-06-09 10:50 ` Dan Carpenter
2023-06-09 15:54 ` Manivannan Sadhasivam
2023-06-09 15:50 ` [PATCH 1/2] PCI: endpoint: Check correct variable in __pci_epf_mhi_alloc_map() Manivannan Sadhasivam
2023-06-14 10:42 ` Lorenzo Pieralisi
2 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2023-06-09 10:50 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
Kishon Vijay Abraham I, Bjorn Helgaas, Damien Le Moal, mhi,
linux-arm-msm, linux-pci, kernel-janitors
The ioremap() function does not return error pointers, it returns NULL
on error.
Fixes: 7db424a84d96 ("PCI: endpoint: Add PCI Endpoint function driver for MHI bus")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/pci/endpoint/functions/pci-epf-mhi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
index e7d64b9d12ff..b45db923306b 100644
--- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
+++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
@@ -354,8 +354,8 @@ static int pci_epf_mhi_bind(struct pci_epf *epf)
epf_mhi->mmio_size = resource_size(res);
epf_mhi->mmio = ioremap(epf_mhi->mmio_phys, epf_mhi->mmio_size);
- if (IS_ERR(epf_mhi->mmio))
- return PTR_ERR(epf_mhi->mmio);
+ if (!epf_mhi->mmio)
+ return -ENOMEM;
ret = platform_get_irq_byname(pdev, "doorbell");
if (ret < 0) {
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] PCI: endpoint: Check correct variable in __pci_epf_mhi_alloc_map()
2023-06-09 10:49 [PATCH 1/2] PCI: endpoint: Check correct variable in __pci_epf_mhi_alloc_map() Dan Carpenter
2023-06-09 10:50 ` [PATCH 2/2] PCI: endpoint: Fix an IS_ERR() vs NULL bug Dan Carpenter
@ 2023-06-09 15:50 ` Manivannan Sadhasivam
2023-06-14 10:42 ` Lorenzo Pieralisi
2 siblings, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2023-06-09 15:50 UTC (permalink / raw)
To: Dan Carpenter
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
Kishon Vijay Abraham I, Bjorn Helgaas, Damien Le Moal, mhi,
linux-arm-msm, linux-pci, kernel-janitors
On Fri, Jun 09, 2023 at 01:49:33PM +0300, Dan Carpenter wrote:
> This was intended to check "*vaddr" instead of "vaddr" (without an
> asterisk).
>
> Fixes: 7db424a84d96 ("PCI: endpoint: Add PCI Endpoint function driver for MHI bus")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/pci/endpoint/functions/pci-epf-mhi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
> index 1227f059ea12..e7d64b9d12ff 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
> @@ -112,7 +112,7 @@ static int __pci_epf_mhi_alloc_map(struct mhi_ep_cntrl *mhi_cntrl, u64 pci_addr,
> int ret;
>
> *vaddr = pci_epc_mem_alloc_addr(epc, paddr, size + offset);
> - if (!vaddr)
> + if (!*vaddr)
> return -ENOMEM;
>
> ret = pci_epc_map_addr(epc, epf->func_no, epf->vfunc_no, *paddr,
> --
> 2.39.2
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] PCI: endpoint: Fix an IS_ERR() vs NULL bug
2023-06-09 10:50 ` [PATCH 2/2] PCI: endpoint: Fix an IS_ERR() vs NULL bug Dan Carpenter
@ 2023-06-09 15:54 ` Manivannan Sadhasivam
0 siblings, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2023-06-09 15:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
Kishon Vijay Abraham I, Bjorn Helgaas, Damien Le Moal, mhi,
linux-arm-msm, linux-pci, kernel-janitors
On Fri, Jun 09, 2023 at 01:50:09PM +0300, Dan Carpenter wrote:
> The ioremap() function does not return error pointers, it returns NULL
> on error.
>
> Fixes: 7db424a84d96 ("PCI: endpoint: Add PCI Endpoint function driver for MHI bus")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/pci/endpoint/functions/pci-epf-mhi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
> index e7d64b9d12ff..b45db923306b 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
> @@ -354,8 +354,8 @@ static int pci_epf_mhi_bind(struct pci_epf *epf)
> epf_mhi->mmio_size = resource_size(res);
>
> epf_mhi->mmio = ioremap(epf_mhi->mmio_phys, epf_mhi->mmio_size);
> - if (IS_ERR(epf_mhi->mmio))
> - return PTR_ERR(epf_mhi->mmio);
> + if (!epf_mhi->mmio)
> + return -ENOMEM;
>
> ret = platform_get_irq_byname(pdev, "doorbell");
> if (ret < 0) {
> --
> 2.39.2
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] PCI: endpoint: Check correct variable in __pci_epf_mhi_alloc_map()
2023-06-09 10:49 [PATCH 1/2] PCI: endpoint: Check correct variable in __pci_epf_mhi_alloc_map() Dan Carpenter
2023-06-09 10:50 ` [PATCH 2/2] PCI: endpoint: Fix an IS_ERR() vs NULL bug Dan Carpenter
2023-06-09 15:50 ` [PATCH 1/2] PCI: endpoint: Check correct variable in __pci_epf_mhi_alloc_map() Manivannan Sadhasivam
@ 2023-06-14 10:42 ` Lorenzo Pieralisi
2 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Pieralisi @ 2023-06-14 10:42 UTC (permalink / raw)
To: Manivannan Sadhasivam, Dan Carpenter
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
Kishon Vijay Abraham I, Bjorn Helgaas, Damien Le Moal, mhi,
linux-arm-msm, linux-pci, kernel-janitors
On Fri, 09 Jun 2023 13:49:33 +0300, Dan Carpenter wrote:
> This was intended to check "*vaddr" instead of "vaddr" (without an
> asterisk).
>
>
Squashed in the commit they are fixing, thanks !!
Thanks,
Lorenzo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-06-14 10:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-09 10:49 [PATCH 1/2] PCI: endpoint: Check correct variable in __pci_epf_mhi_alloc_map() Dan Carpenter
2023-06-09 10:50 ` [PATCH 2/2] PCI: endpoint: Fix an IS_ERR() vs NULL bug Dan Carpenter
2023-06-09 15:54 ` Manivannan Sadhasivam
2023-06-09 15:50 ` [PATCH 1/2] PCI: endpoint: Check correct variable in __pci_epf_mhi_alloc_map() Manivannan Sadhasivam
2023-06-14 10:42 ` Lorenzo Pieralisi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).