提交 771b7bf0 编写于 作者: P Pierre-Yves MORDRET 提交者: Wolfram Sang

i2c: i2c-stm32f7: fix no check on returned setup

Before assigning returned setup structure check if not null

Fixes: 463a9215 ("i2c: stm32f7: fix setup structure")
Signed-off-by: NPierre-Yves MORDRET <pierre-yves.mordret@st.com>
Acked-by: NAlexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
上级 c698ca52
......@@ -888,6 +888,11 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)
}
setup = of_device_get_match_data(&pdev->dev);
if (!setup) {
dev_err(&pdev->dev, "Can't get device data\n");
ret = -ENODEV;
goto clk_free;
}
i2c_dev->setup = *setup;
ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册