usb: cdns3: fix NULL pointer dereference on no platform data
authorRoger Quadros <rogerq@ti.com>
Mon, 23 Nov 2020 10:49:31 +0000 (12:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Mar 2021 13:17:26 +0000 (14:17 +0100)
commit0ff1f97510fde30905cb8cafbd5b0daca72e2315
treea96cc56b5e6303c91ca3eb73ce862a46a7a17d61
parent8694c4e2b19c26bc4c0a714d362f6b53cde2d650
usb: cdns3: fix NULL pointer dereference on no platform data

[ Upstream commit 448373d9db1a7000072f65103af19e20503f0c0c ]

Some platforms (e.g. TI) will not have any platform data which will
lead to NULL pointer dereference if we don't check for NULL pdata.

Fixes: 7cea9657756b ("usb: cdns3: add quirk for enable runtime pm by default")
Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/cdns3/core.c
drivers/usb/cdns3/host.c