Re: [PATCH v5 2/3] dwc: PCI: intel: PCIe RC controller driver

From: Dilip Kota
Date: Tue Nov 12 2019 - 02:18:15 EST



On 11/11/2019 4:08 PM, Dilip Kota wrote:

On 11/6/2019 8:24 PM, Andy Shevchenko wrote:
On Wed, Nov 06, 2019 at 11:44:02AM +0800, Dilip Kota wrote:
[...]

+ÂÂÂ return ret;
+}
+ÂÂÂ platform_set_drvdata(pdev, lpp);
I think it makes sense to setup at the end of the function (before dev_info()
call).
I have done it immediately after the memory allocation.
Ok, i will move it before dev_info().

I ran test with all the changes and kernel panic is hit due to NULL pointer access. It is because of platform_set_drvdata() moved before dev_info, which resulted in intel_pcie_get_resources() doing platform_get_drvdata and end up accessing NULL pointer. I will keep 'platform_set_drvdata()' remain unchanged.

Regards,
Dilip