From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: From: "Jingoo Han" To: "'Jaehoon Chung'" , References: <20180122022854.3634-1-jh80.chung@samsung.com> In-Reply-To: <20180122022854.3634-1-jh80.chung@samsung.com> Subject: Re: [PATCH] PCI: exynos: fix the potential null pointer dereference Date: Mon, 22 Jan 2018 11:52:46 -0500 Message-ID: <000201d393a1$6e7c8b70$4b75a250$@gmail.com> MIME-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lorenzo.pieralisi@arm.com, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, kgene@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+bjorn=helgaas.com@lists.infradead.org List-ID: 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 Acked-by: Jingoo Han 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