Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1594111 > unrolled thread

[PATCH] PCI: exynos: fix the NULL pointer dereference about elbi_base

Started byJaehoon Chung <jh80.chung@samsung.com>
First post2017-03-07 12:00 +0100
Last post2017-03-07 20:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] PCI: exynos: fix the NULL pointer dereference about elbi_base Jaehoon Chung <jh80.chung@samsung.com> - 2017-03-07 12:00 +0100
    Re: [PATCH] PCI: exynos: fix the NULL pointer dereference about  elbi_base Bjorn Helgaas <helgaas@kernel.org> - 2017-03-07 20:00 +0100

#1594111 — [PATCH] PCI: exynos: fix the NULL pointer dereference about elbi_base

FromJaehoon Chung <jh80.chung@samsung.com>
Date2017-03-07 12:00 +0100
Subject[PATCH] PCI: exynos: fix the NULL pointer dereference about elbi_base
Message-ID<til0t-6mK-11@gated-at.bofh.it>
Even though using phy framework, it has to get the elbi_base.
Before this patch, elbi_base should be NULL pointer.

Fixes: e7cd7ef58e1f ("PCI: exynos: Support the PHY generic framework")

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/pci/dwc/pci-exynos.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
index 993b650..44f774c 100644
--- a/drivers/pci/dwc/pci-exynos.c
+++ b/drivers/pci/dwc/pci-exynos.c
@@ -132,10 +132,6 @@ static int exynos5440_pcie_get_mem_resources(struct platform_device *pdev,
 	struct device *dev = pci->dev;
 	struct resource *res;
 
-	/* If using the PHY framework, doesn't need to get other resource */
-	if (ep->using_phy)
-		return 0;
-
 	ep->mem_res = devm_kzalloc(dev, sizeof(*ep->mem_res), GFP_KERNEL);
 	if (!ep->mem_res)
 		return -ENOMEM;
@@ -145,6 +141,10 @@ static int exynos5440_pcie_get_mem_resources(struct platform_device *pdev,
 	if (IS_ERR(ep->mem_res->elbi_base))
 		return PTR_ERR(ep->mem_res->elbi_base);
 
+	/* If using the PHY framework, doesn't need to get other resource */
+	if (ep->using_phy)
+		return 0;
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	ep->mem_res->phy_base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(ep->mem_res->phy_base))
-- 
2.10.2

[toc] | [next] | [standalone]


#1594537 — Re: [PATCH] PCI: exynos: fix the NULL pointer dereference about elbi_base

FromBjorn Helgaas <helgaas@kernel.org>
Date2017-03-07 20:00 +0100
SubjectRe: [PATCH] PCI: exynos: fix the NULL pointer dereference about elbi_base
Message-ID<tisv0-3b1-1@gated-at.bofh.it>
In reply to#1594111
On Tue, Mar 07, 2017 at 07:54:05PM +0900, Jaehoon Chung wrote:
> Even though using phy framework, it has to get the elbi_base.
> Before this patch, elbi_base should be NULL pointer.
> 
> Fixes: e7cd7ef58e1f ("PCI: exynos: Support the PHY generic framework")
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>

Provisionally applied to for-linus for v4.11, pending Jingoo's ack.
Thanks, Jaehoon!

> ---
>  drivers/pci/dwc/pci-exynos.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
> index 993b650..44f774c 100644
> --- a/drivers/pci/dwc/pci-exynos.c
> +++ b/drivers/pci/dwc/pci-exynos.c
> @@ -132,10 +132,6 @@ static int exynos5440_pcie_get_mem_resources(struct platform_device *pdev,
>  	struct device *dev = pci->dev;
>  	struct resource *res;
>  
> -	/* If using the PHY framework, doesn't need to get other resource */
> -	if (ep->using_phy)
> -		return 0;
> -
>  	ep->mem_res = devm_kzalloc(dev, sizeof(*ep->mem_res), GFP_KERNEL);
>  	if (!ep->mem_res)
>  		return -ENOMEM;
> @@ -145,6 +141,10 @@ static int exynos5440_pcie_get_mem_resources(struct platform_device *pdev,
>  	if (IS_ERR(ep->mem_res->elbi_base))
>  		return PTR_ERR(ep->mem_res->elbi_base);
>  
> +	/* If using the PHY framework, doesn't need to get other resource */
> +	if (ep->using_phy)
> +		return 0;
> +
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>  	ep->mem_res->phy_base = devm_ioremap_resource(dev, res);
>  	if (IS_ERR(ep->mem_res->phy_base))
> -- 
> 2.10.2
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web