mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 14:44:12 +00:00
phy: mediatek: Fix missing check in mtk_mipi_tx_probe
[ Upstream commit 399c91c3f3
]
The of_device_get_match_data() function may return NULL.
Add check to prevent potential null dereference.
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20211224082103.7658-1-linmq006@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
5895474d21
commit
d543ba3a61
1 changed files with 2 additions and 0 deletions
|
@ -146,6 +146,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
|
|||
return -ENOMEM;
|
||||
|
||||
mipi_tx->driver_data = of_device_get_match_data(dev);
|
||||
if (!mipi_tx->driver_data)
|
||||
return -ENODEV;
|
||||
|
||||
mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(mipi_tx->regs))
|
||||
|
|
Loading…
Reference in a new issue