Skip to content

Commit

Permalink
i2c: i2c-stm32f7: fix no check on returned setup
Browse files Browse the repository at this point in the history
Before assigning returned setup structure check if not null

Fixes: 463a921 ("i2c: stm32f7: fix setup structure")
Signed-off-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
  • Loading branch information
Pierre-Yves MORDRET authored and Wolfram Sang committed Mar 24, 2018
1 parent c698ca5 commit 771b7bf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/i2c/busses/i2c-stm32f7.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 771b7bf

Please sign in to comment.