Skip to contentSkip to conversation

request_module() use format string

PATCH In review maximilian attems 2 participants 3 messages Jun 12, 2008 2 messages not in the archive

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

PATCH 1/1 request_module() use format string

similar to 326f6a5c9c9e1a62aec37bdc0c3f8d53adabe77b, maybe writable by root thus worth fixing.

---
 drivers/of/of_i2c.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/of/of_i2c.c +1 -1
index b2ccdcb..117de8b 100644
@@ -100,7 +100,7 @@ void of_register_i2c_devices(struct i2c_adapter *adap,
 
 		info.addr = *addr;
 
-		request_module(info.type);
+		request_module("%s", info.type);
 
 		result = i2c_new_device(adap, &info);
 		if (result == NULL) {
Signature · 7 lines
1.5.5.1


_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c
Acked-by
#2 lore raw
In reply to a message not in the archive

Hi Maximilian,

Quoted 2 lines · maximilian attems

similar to 326f6a5c9c9e1a62aec37bdc0c3f8d53adabe77b, maybe writable by root thus worth fixing.

I don't think root can affect the value of the string, but the file it is read from could be broken. So yes it seems worth fixing.

Quoted 11 lines
---
 drivers/of/of_i2c.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/of/of_i2c.c +0 -0
index b2ccdcb..117de8b 100644

drivers/of/of_i2c.c void of_register_i2c_devices(struct i2c_adapter *adap, · line 106

Quoted 8 lines
drivers/of/of_i2c.c +1 -1
@@ -100,7 +100,7 @@ void of_register_i2c_devices(struct i2c_adapter *adap,
 
 		info.addr = *addr;
 
-		request_module(info.type);
+		request_module("%s", info.type);
 
 		result = i2c_new_device(adap, &info);
 		if (result == NULL) {

I think you want to send this fix to Jochen Friedrich and Paul Mackerras (both Cc'd) as they are the ones working on this driver.

Signature · 6 lines
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c
#4 lore raw
In reply to a message not in the archive

hello jean,

Quoted 8 lines · Jean Delvare

Hi Maximilian,

Quoted 2 lines · maximilian attems

similar to 326f6a5c9c9e1a62aec37bdc0c3f8d53adabe77b, maybe writable by root thus worth fixing.

I don't think root can affect the value of the string, but the file it is read from could be broken. So yes it seems worth fixing.

thanks for check.

Quoted 17 lines
Quoted 17 lines
---
 drivers/of/of_i2c.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/of/of_i2c.c +1 -1
index b2ccdcb..117de8b 100644
@@ -100,7 +100,7 @@ void of_register_i2c_devices(struct i2c_adapter *adap,
 
 		info.addr = *addr;
 
-		request_module(info.type);
+		request_module("%s", info.type);
 
Quoted 7 lines

drivers/of/of_i2c.c void of_register_i2c_devices(struct i2c_adapter *adap, · line 106

Quoted 2 lines
drivers/of/of_i2c.c +0 -0
 		result = i2c_new_device(adap, &info);
 		if (result == NULL) {

I think you want to send this fix to Jochen Friedrich and Paul Mackerras (both Cc'd) as they are the ones working on this driver.

will do in a minute, with fixed desc.

Signature · 6 lines
maks

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c