OSDN Git Service

ARM: davinci: da8xx: fix oops in USB PHY driver due to stack allocated platform_data
authorDavid Lechner <david@lechnology.com>
Thu, 15 Mar 2018 19:17:20 +0000 (14:17 -0500)
committerSekhar Nori <nsekhar@ti.com>
Thu, 29 Mar 2018 06:48:32 +0000 (12:18 +0530)
commit3424a516d9d2d3fa45c63750c15ea2bba893ea81
tree94dfb6af1f4793d297e5f258f2c30dbef4e34691
parent96c081735d5197d9d4fa0b6ce84cffa3bb197474
ARM: davinci: da8xx: fix oops in USB PHY driver due to stack allocated platform_data

This fixes a possible kernel oops due to using stack allocated platform
data for the USB PHY driver on DA8XX devices. If the platform device
probe is deferred, then we get a corrupt pointer for the platform data.

We now use a global static struct for the platform data so that the
platform data pointer does not get written over.

Fixes: bdec5a6b5789 ("ARM: da8xx: use platform data for CFGCHIP syscon regmap")
Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arch/arm/mach-davinci/usb-da8xx.c