Explorar o código

realtek: i2c-rtl9300: fix crash on block transfers

Fix a typo which resulted in wrong .read hooks and unset .write
hooks.  This made I2C_SMBUS_BLOCK_DATA transfers dereference the
NULL .write hook and Oops.

Signed-off-by: Bjørn Mork <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/17950
Signed-off-by: Sander Vanheule <[email protected]>
Bjørn Mork hai 11 meses
pai
achega
ef4b022150

+ 2 - 2
target/linux/realtek/files-6.6/drivers/i2c/busses/i2c-rtl9300.c

@@ -436,7 +436,7 @@ struct i2c_drv_data rtl9300_i2c_drv_data = {
 	.scl1_pin = 17,
 	.sda0_pin = 9,
 	.read = rtl9300_i2c_read,
-	.read = rtl9300_i2c_write,
+	.write = rtl9300_i2c_write,
 	.reg_addr_set = rtl9300_i2c_reg_addr_set,
 	.config_xfer = rtl9300_i2c_config_xfer,
 	.execute_xfer = rtl9300_execute_xfer,
@@ -450,7 +450,7 @@ struct i2c_drv_data rtl9310_i2c_drv_data = {
 	.scl1_pin = 14,
 	.sda0_pin = 0,
 	.read = rtl9310_i2c_read,
-	.read = rtl9310_i2c_write,
+	.write = rtl9310_i2c_write,
 	.reg_addr_set = rtl9310_i2c_reg_addr_set,
 	.config_xfer = rtl9310_i2c_config_xfer,
 	.execute_xfer = rtl9310_execute_xfer,