[openwrt/openwrt] realtek: i2c-rtl9300: fix crash on block transfers

LEDE Commits lede-commits at lists.infradead.org
Tue Feb 25 11:57:49 PST 2025


svanheule pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/ef4b022150a44e4e6c565f8f2e73ffae9175d01e

commit ef4b022150a44e4e6c565f8f2e73ffae9175d01e
Author: Bjørn Mork <bjorn at mork.no>
AuthorDate: Wed Feb 5 07:19:10 2025 +0100

    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 <bjorn at mork.no>
    Link: https://github.com/openwrt/openwrt/pull/17950
    Signed-off-by: Sander Vanheule <sander at svanheule.net>
---
 target/linux/realtek/files-6.6/drivers/i2c/busses/i2c-rtl9300.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/realtek/files-6.6/drivers/i2c/busses/i2c-rtl9300.c b/target/linux/realtek/files-6.6/drivers/i2c/busses/i2c-rtl9300.c
index 51b19978a0..9565c4756f 100644
--- a/target/linux/realtek/files-6.6/drivers/i2c/busses/i2c-rtl9300.c
+++ b/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,




More information about the lede-commits mailing list