Commit 399c91c3 authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Vinod Koul

phy: mediatek: Fix missing check in mtk_mipi_tx_probe

The of_device_get_match_data() function may return NULL.
Add check to prevent potential null dereference.
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20211224082103.7658-1-linmq006@gmail.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 898c7a9e
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment