Skip to contentSkip to conversation

HID: ft260: fix an error message in ft260_i2c_write_read()

PATCH Applied Dan Carpenter 3 participants 3 messages Mar 18, 2021 – Mar 19, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: ft260: fix an error message in ft260_i2c_write_read()

The "len" variable is uninitialize.

Fixes 6a82582d9fa4 ("HID: ft260: add usb hid to i2c host bridge driver")
---
 drivers/hid/hid-ft260.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hid/hid-ft260.c +2 -1
index 047aa85a7c83..a5751607ce24 100644
@@ -512,7 +512,8 @@ static int ft260_i2c_write_read(struct ft260_device *dev, struct i2c_msg *msgs)
 	struct hid_device *hdev = dev->hdev;
 
 	if (msgs[0].len > 2) {
-		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__, len);
+		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__,
+			msgs[0].len);
 		return -EOPNOTSUPP;
 	}
 
Signature · 1 line
2.30.2
maintainer Applied
#1 lore raw
Quoted 13 lines · Dan Carpenter

The "len" variable is uninitialize.

Fixes 6a82582d9fa4 ("HID: ft260: add usb hid to i2c host bridge driver")
---
 drivers/hid/hid-ft260.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hid/hid-ft260.c +0 -0
index 047aa85a7c83..a5751607ce24 100644

drivers/hid/hid-ft260.c static int ft260_i2c_write_read(struct ft260_device *dev, struct i2c_msg *msgs) · line 518

Quoted 8 lines
drivers/hid/hid-ft260.c +2 -1
@@ -512,7 +512,8 @@ static int ft260_i2c_write_read(struct ft260_device *dev, struct i2c_msg *msgs)
 	struct hid_device *hdev = dev->hdev;
 
 	if (msgs[0].len > 2) {
-		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__, len);
+		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__,
+			msgs[0].len);
 		return -EOPNOTSUPP;
 	}

Applied, thanks Dan.

Signature · 2 lines
Jiri Kosina
SUSE Labs
maintainer
#2 lore raw
Quoted 17 lines · Jiri Kosina
Quoted 15 lines · Dan Carpenter

The "len" variable is uninitialize.

Fixes 6a82582d9fa4 ("HID: ft260: add usb hid to i2c host bridge driver")
---
 drivers/hid/hid-ft260.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hid/hid-ft260.c +0 -0
index 047aa85a7c83..a5751607ce24 100644
@@ -512,7 +512,8 @@ static int ft260_i2c_write_read(struct ft260_device *dev, struct i2c_msg *msgs)
 	struct hid_device *hdev = dev->hdev;
 
Quoted 6 lines

drivers/hid/hid-ft260.c static int ft260_i2c_write_read(struct ft260_device *dev, struct i2c_msg *msgs) · line 518

Quoted 6 lines
drivers/hid/hid-ft260.c +2 -1
 	if (msgs[0].len > 2) {
-		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__, len);
+		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__,
+			msgs[0].len);
 		return -EOPNOTSUPP;
 	}

Dan, thanks for that quick fix.

Quoted 3 lines

Applied, thanks Dan.

Signature · 1 line
Jiri Kosina

Jiri, thank you for applying it.