]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
phy: tegra: xusb: check return value of devm_kzalloc()
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Wed, 31 May 2023 07:39:50 +0000 (10:39 +0300)
committerVinod Koul <vkoul@kernel.org>
Wed, 21 Jun 2023 17:58:52 +0000 (23:28 +0530)
commit44faada0f38fc333d392af04c343b0e23f8f5d81
tree3d4084c2092cb7420e689f8b22ed9ec008160798
parent6cd52a2a06774c6c454ffef084c3d9b17618ca23
phy: tegra: xusb: check return value of devm_kzalloc()

devm_kzalloc() returns a pointer to dynamically allocated memory.
Pointer could be NULL in case allocation fails. Check pointer validity.
Identified with coccinelle (kmerr.cocci script).

Fixes: f67213cee2b3 ("phy: tegra: xusb: Add usb-role-switch support")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20230531073950.145339-1-claudiu.beznea@microchip.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/tegra/xusb.c