linux-stable/drivers/i2c
Wolfram Sang e3425674ff i2c: smbus: fix NULL function pointer dereference
[ Upstream commit 91811a31b6 ]

Baruch reported an OOPS when using the designware controller as target
only. Target-only modes break the assumption of one transfer function
always being available. Fix this by always checking the pointer in
__i2c_transfer.

Reported-by: Baruch Siach <baruch@tkos.co.il>
Closes: https://lore.kernel.org/r/4269631780e5ba789cf1ae391eec1b959def7d99.1712761976.git.baruch@tkos.co.il
Fixes: 4b1acc4333 ("i2c: core changes for slave support")
[wsa: dropped the simplification in core-smbus to avoid theoretical regressions]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-05-02 16:32:49 +02:00
..
algos i2c: algo: bit: allow getsda to be NULL 2023-01-23 23:15:49 +01:00
busses i2c: designware: Fix RX FIFO depth define on Wangxun 10Gb NIC 2024-04-13 13:07:35 +02:00
muxes i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node() 2023-10-21 19:57:18 +02:00
Kconfig i2c: Make I2C_ATR invisible 2023-09-13 10:56:00 +02:00
Makefile media: i2c: add I2C Address Translator (ATR) support 2023-07-14 13:11:44 +02:00
i2c-atr.c media: i2c: add I2C Address Translator (ATR) support 2023-07-14 13:11:44 +02:00
i2c-boardinfo.c
i2c-core-acpi.c i2c: add fwnode APIs 2023-01-17 09:29:59 +01:00
i2c-core-base.c i2c: smbus: fix NULL function pointer dereference 2024-05-02 16:32:49 +02:00
i2c-core-of.c Char/Misc drivers for 6.4-rc1 2023-04-27 12:07:50 -07:00
i2c-core-slave.c i2c: add tracepoints for I2C slave events 2022-03-20 00:11:05 +01:00
i2c-core-smbus.c i2c: smbus: Check for parent device before dereference 2022-02-19 12:37:20 +01:00
i2c-core.h i2c: core: Fix atomic xfer check for non-preempt config 2024-01-10 17:17:00 +01:00
i2c-dev.c i2c: dev: copy userspace array safely 2023-11-28 17:19:47 +00:00
i2c-mux.c i2c: mux: Avoid potential false error message in i2c_mux_add_adapter 2023-09-25 08:22:02 +02:00
i2c-slave-eeprom.c i2c: Convert drivers to new .probe() callback 2023-03-09 21:59:30 +01:00
i2c-slave-testunit.c i2c: Convert drivers to new .probe() callback 2023-03-09 21:59:30 +01:00
i2c-smbus.c i2c: Convert drivers to new .probe() callback 2023-03-09 21:59:30 +01:00
i2c-stub.c