* [PATCH] PCI: exynos: fix the potential null pointer dereference
[not found] <CGME20180122022856epcas1p494a9efeae478b299e3e8006adad71e6a@epcas1p4.samsung.com>
2018-01-22 2:28 ` Jaehoon Chung
@ 2018-01-22 2:28 ` Jaehoon Chung
0 siblings, 0 replies; 9+ messages in thread
From: Jaehoon Chung @ 2018-01-22 2:28 UTC (permalink / raw)
To: linux-pci
Cc: linux-samsung-soc, jingoohan1, krzk, Jaehoon Chung, kgene,
lorenzo.pieralisi, linux-arm-kernel
Before calling the callback function, it needs to check whether
init_clk_resources is assigned or not.
Otherwise, it can be occurred the NULL pointer dereference when
init_clk_resources is not assigned.
Even though init_clk_resources is assigned now, it needs to prevent the
potential NULL pointer dereference in future.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
drivers/pci/dwc/pci-exynos.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
index 56f32aeebd0a..39f08881f9a4 100644
--- a/drivers/pci/dwc/pci-exynos.c
+++ b/drivers/pci/dwc/pci-exynos.c
@@ -499,7 +499,8 @@ static int __init exynos_pcie_probe(struct platform_device *pdev)
return ret;
}
- if (ep->ops && ep->ops->get_clk_resources) {
+ if (ep->ops && ep->ops->get_clk_resources &&
+ ep->ops->init_clk_resources) {
ret = ep->ops->get_clk_resources(ep);
if (ret)
return ret;
--
2.15.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] PCI: exynos: fix the potential null pointer dereference
@ 2018-01-22 2:28 ` Jaehoon Chung
0 siblings, 0 replies; 9+ messages in thread
From: Jaehoon Chung @ 2018-01-22 2:28 UTC (permalink / raw)
To: linux-pci
Cc: linux-arm-kernel, linux-samsung-soc, jingoohan1,
lorenzo.pieralisi, kgene, krzk, Jaehoon Chung
Before calling the callback function, it needs to check whether
init_clk_resources is assigned or not.
Otherwise, it can be occurred the NULL pointer dereference when
init_clk_resources is not assigned.
Even though init_clk_resources is assigned now, it needs to prevent the
potential NULL pointer dereference in future.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
drivers/pci/dwc/pci-exynos.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
index 56f32aeebd0a..39f08881f9a4 100644
--- a/drivers/pci/dwc/pci-exynos.c
+++ b/drivers/pci/dwc/pci-exynos.c
@@ -499,7 +499,8 @@ static int __init exynos_pcie_probe(struct platform_device *pdev)
return ret;
}
- if (ep->ops && ep->ops->get_clk_resources) {
+ if (ep->ops && ep->ops->get_clk_resources &&
+ ep->ops->init_clk_resources) {
ret = ep->ops->get_clk_resources(ep);
if (ret)
return ret;
--
2.15.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] PCI: exynos: fix the potential null pointer dereference
@ 2018-01-22 2:28 ` Jaehoon Chung
0 siblings, 0 replies; 9+ messages in thread
From: Jaehoon Chung @ 2018-01-22 2:28 UTC (permalink / raw)
To: linux-arm-kernel
Before calling the callback function, it needs to check whether
init_clk_resources is assigned or not.
Otherwise, it can be occurred the NULL pointer dereference when
init_clk_resources is not assigned.
Even though init_clk_resources is assigned now, it needs to prevent the
potential NULL pointer dereference in future.
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
drivers/pci/dwc/pci-exynos.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
index 56f32aeebd0a..39f08881f9a4 100644
--- a/drivers/pci/dwc/pci-exynos.c
+++ b/drivers/pci/dwc/pci-exynos.c
@@ -499,7 +499,8 @@ static int __init exynos_pcie_probe(struct platform_device *pdev)
return ret;
}
- if (ep->ops && ep->ops->get_clk_resources) {
+ if (ep->ops && ep->ops->get_clk_resources &&
+ ep->ops->init_clk_resources) {
ret = ep->ops->get_clk_resources(ep);
if (ret)
return ret;
--
2.15.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] PCI: exynos: fix the potential null pointer dereference
2018-01-22 2:28 ` Jaehoon Chung
(?)
@ 2018-01-22 16:52 ` Jingoo Han
-1 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2018-01-22 16:52 UTC (permalink / raw)
To: 'Jaehoon Chung', linux-pci
Cc: lorenzo.pieralisi, krzk, linux-samsung-soc, kgene, linux-arm-kernel
On Sunday, January 21, 2018 6:29 PM, Jaehoon Chung wrote:
>
> Before calling the callback function, it needs to check whether
> init_clk_resources is assigned or not.
> Otherwise, it can be occurred the NULL pointer dereference when
> init_clk_resources is not assigned.
>
> Even though init_clk_resources is assigned now, it needs to prevent the
> potential NULL pointer dereference in future.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Best regards,
Jingoo Han
> ---
> drivers/pci/dwc/pci-exynos.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
> index 56f32aeebd0a..39f08881f9a4 100644
> --- a/drivers/pci/dwc/pci-exynos.c
> +++ b/drivers/pci/dwc/pci-exynos.c
> @@ -499,7 +499,8 @@ static int __init exynos_pcie_probe(struct
> platform_device *pdev)
> return ret;
> }
>
> - if (ep->ops && ep->ops->get_clk_resources) {
> + if (ep->ops && ep->ops->get_clk_resources &&
> + ep->ops->init_clk_resources) {
> ret = ep->ops->get_clk_resources(ep);
> if (ret)
> return ret;
> --
> 2.15.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] PCI: exynos: fix the potential null pointer dereference
@ 2018-01-22 16:52 ` Jingoo Han
0 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2018-01-22 16:52 UTC (permalink / raw)
To: 'Jaehoon Chung', linux-pci
Cc: linux-arm-kernel, linux-samsung-soc, lorenzo.pieralisi, kgene, krzk
On Sunday, January 21, 2018 6:29 PM, Jaehoon Chung wrote:
>
> Before calling the callback function, it needs to check whether
> init_clk_resources is assigned or not.
> Otherwise, it can be occurred the NULL pointer dereference when
> init_clk_resources is not assigned.
>
> Even though init_clk_resources is assigned now, it needs to prevent the
> potential NULL pointer dereference in future.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Best regards,
Jingoo Han
> ---
> drivers/pci/dwc/pci-exynos.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
> index 56f32aeebd0a..39f08881f9a4 100644
> --- a/drivers/pci/dwc/pci-exynos.c
> +++ b/drivers/pci/dwc/pci-exynos.c
> @@ -499,7 +499,8 @@ static int __init exynos_pcie_probe(struct
> platform_device *pdev)
> return ret;
> }
>
> - if (ep->ops && ep->ops->get_clk_resources) {
> + if (ep->ops && ep->ops->get_clk_resources &&
> + ep->ops->init_clk_resources) {
> ret = ep->ops->get_clk_resources(ep);
> if (ret)
> return ret;
> --
> 2.15.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] PCI: exynos: fix the potential null pointer dereference
@ 2018-01-22 16:52 ` Jingoo Han
0 siblings, 0 replies; 9+ messages in thread
From: Jingoo Han @ 2018-01-22 16:52 UTC (permalink / raw)
To: linux-arm-kernel
On Sunday, January 21, 2018 6:29 PM, Jaehoon Chung wrote:
>
> Before calling the callback function, it needs to check whether
> init_clk_resources is assigned or not.
> Otherwise, it can be occurred the NULL pointer dereference when
> init_clk_resources is not assigned.
>
> Even though init_clk_resources is assigned now, it needs to prevent the
> potential NULL pointer dereference in future.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Best regards,
Jingoo Han
> ---
> drivers/pci/dwc/pci-exynos.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
> index 56f32aeebd0a..39f08881f9a4 100644
> --- a/drivers/pci/dwc/pci-exynos.c
> +++ b/drivers/pci/dwc/pci-exynos.c
> @@ -499,7 +499,8 @@ static int __init exynos_pcie_probe(struct
> platform_device *pdev)
> return ret;
> }
>
> - if (ep->ops && ep->ops->get_clk_resources) {
> + if (ep->ops && ep->ops->get_clk_resources &&
> + ep->ops->init_clk_resources) {
> ret = ep->ops->get_clk_resources(ep);
> if (ret)
> return ret;
> --
> 2.15.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] PCI: exynos: fix the potential null pointer dereference
2018-01-22 2:28 ` Jaehoon Chung
(?)
@ 2018-01-29 17:10 ` Lorenzo Pieralisi
-1 siblings, 0 replies; 9+ messages in thread
From: Lorenzo Pieralisi @ 2018-01-29 17:10 UTC (permalink / raw)
To: Jaehoon Chung
Cc: linux-samsung-soc, linux-pci, krzk, kgene, jingoohan1, linux-arm-kernel
On Mon, Jan 22, 2018 at 11:28:54AM +0900, Jaehoon Chung wrote:
> Before calling the callback function, it needs to check whether
> init_clk_resources is assigned or not.
> Otherwise, it can be occurred the NULL pointer dereference when
> init_clk_resources is not assigned.
>
> Even though init_clk_resources is assigned now, it needs to prevent the
> potential NULL pointer dereference in future.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
> drivers/pci/dwc/pci-exynos.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
> index 56f32aeebd0a..39f08881f9a4 100644
> --- a/drivers/pci/dwc/pci-exynos.c
> +++ b/drivers/pci/dwc/pci-exynos.c
> @@ -499,7 +499,8 @@ static int __init exynos_pcie_probe(struct platform_device *pdev)
> return ret;
> }
>
> - if (ep->ops && ep->ops->get_clk_resources) {
> + if (ep->ops && ep->ops->get_clk_resources &&
> + ep->ops->init_clk_resources) {
> ret = ep->ops->get_clk_resources(ep);
> if (ret)
> return ret;
> --
> 2.15.1
I applied it to pci/dwc for 4.16.
Thanks,
Lorenzo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] PCI: exynos: fix the potential null pointer dereference
@ 2018-01-29 17:10 ` Lorenzo Pieralisi
0 siblings, 0 replies; 9+ messages in thread
From: Lorenzo Pieralisi @ 2018-01-29 17:10 UTC (permalink / raw)
To: Jaehoon Chung
Cc: linux-pci, linux-arm-kernel, linux-samsung-soc, jingoohan1, kgene, krzk
On Mon, Jan 22, 2018 at 11:28:54AM +0900, Jaehoon Chung wrote:
> Before calling the callback function, it needs to check whether
> init_clk_resources is assigned or not.
> Otherwise, it can be occurred the NULL pointer dereference when
> init_clk_resources is not assigned.
>
> Even though init_clk_resources is assigned now, it needs to prevent the
> potential NULL pointer dereference in future.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
> drivers/pci/dwc/pci-exynos.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
> index 56f32aeebd0a..39f08881f9a4 100644
> --- a/drivers/pci/dwc/pci-exynos.c
> +++ b/drivers/pci/dwc/pci-exynos.c
> @@ -499,7 +499,8 @@ static int __init exynos_pcie_probe(struct platform_device *pdev)
> return ret;
> }
>
> - if (ep->ops && ep->ops->get_clk_resources) {
> + if (ep->ops && ep->ops->get_clk_resources &&
> + ep->ops->init_clk_resources) {
> ret = ep->ops->get_clk_resources(ep);
> if (ret)
> return ret;
> --
> 2.15.1
I applied it to pci/dwc for 4.16.
Thanks,
Lorenzo
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] PCI: exynos: fix the potential null pointer dereference
@ 2018-01-29 17:10 ` Lorenzo Pieralisi
0 siblings, 0 replies; 9+ messages in thread
From: Lorenzo Pieralisi @ 2018-01-29 17:10 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jan 22, 2018 at 11:28:54AM +0900, Jaehoon Chung wrote:
> Before calling the callback function, it needs to check whether
> init_clk_resources is assigned or not.
> Otherwise, it can be occurred the NULL pointer dereference when
> init_clk_resources is not assigned.
>
> Even though init_clk_resources is assigned now, it needs to prevent the
> potential NULL pointer dereference in future.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
> drivers/pci/dwc/pci-exynos.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/dwc/pci-exynos.c b/drivers/pci/dwc/pci-exynos.c
> index 56f32aeebd0a..39f08881f9a4 100644
> --- a/drivers/pci/dwc/pci-exynos.c
> +++ b/drivers/pci/dwc/pci-exynos.c
> @@ -499,7 +499,8 @@ static int __init exynos_pcie_probe(struct platform_device *pdev)
> return ret;
> }
>
> - if (ep->ops && ep->ops->get_clk_resources) {
> + if (ep->ops && ep->ops->get_clk_resources &&
> + ep->ops->init_clk_resources) {
> ret = ep->ops->get_clk_resources(ep);
> if (ret)
> return ret;
> --
> 2.15.1
I applied it to pci/dwc for 4.16.
Thanks,
Lorenzo
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-01-29 17:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20180122022856epcas1p494a9efeae478b299e3e8006adad71e6a@epcas1p4.samsung.com>
2018-01-22 2:28 ` [PATCH] PCI: exynos: fix the potential null pointer dereference Jaehoon Chung
2018-01-22 2:28 ` Jaehoon Chung
2018-01-22 2:28 ` Jaehoon Chung
2018-01-22 16:52 ` Jingoo Han
2018-01-22 16:52 ` Jingoo Han
2018-01-22 16:52 ` Jingoo Han
2018-01-29 17:10 ` Lorenzo Pieralisi
2018-01-29 17:10 ` Lorenzo Pieralisi
2018-01-29 17:10 ` Lorenzo Pieralisi
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.