Skip to contentSkip to conversation

fix OOPS in platform uevent

PATCH In review Stephen Hemminger 2 participants 4 messages Sep 20, 2007 – Sep 22, 2007 1 message not in the archive

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

PATCH 1/3 fix OOPS in platform uevent

In reply to a message not in the archive

Environment wasn't being NULL terminated.
Suggested by Kay Sievers

drivers/base/platform.c +1 -0
@@ -546,6 +546,7 @@ static int platform_uevent(struct device
 	struct platform_device	*pdev = to_platform_device(dev);
 
 	envp[0] = buffer;
+	envp[1] = NULL;
 	snprintf(buffer, buffer_size, "MODALIAS=%s", pdev->name);
 	return 0;
 }
Signature · 1 line
Stephen Hemminger <[email protected]>
#2 lore raw

PATCH 2/3 missing null termination in power supply uevent

In reply to a message not in the archive

Need to null terminate environment. Found by inspection while looking for similar problems to platform uevent bug

drivers/power/power_supply_sysfs.c +1 -0
@@ -289,6 +289,7 @@ int power_supply_uevent(struct device *d
 		if (ret)
 			goto out;
 	}
+	envp[i] = NULL;
 
 out:
 	free_page((unsigned long)prop_buf);
Signature · 1 line
Stephen Hemminger <[email protected]>
#4 lore raw

PATCH 3/3 missing null termination in one wire uevent

In reply to a message not in the archive

Need to null terminate environment. Found by inspection while looking for similar problems to platform uevent bug

drivers/w1/w1.c +1 -0
@@ -431,6 +431,7 @@ static int w1_uevent(struct device *dev,
 	err = add_uevent_var(envp, num_envp, &cur_index, buffer, buffer_size,
 			&cur_len, "W1_SLAVE_ID=%024LX",
 			(unsigned long long)sl->reg_num.id);
+	envp[cur_index] = NULL;
 	if (err)
 		return err;
 
Signature · 1 line
Stephen Hemminger <[email protected]>
#3 lore raw

Re: [PATCH 2/3] missing null termination in power supply uevent

In reply to Stephen Hemminger
Quoted 4 lines · Stephen Hemminger

Need to null terminate environment. Found by inspection while looking for similar problems to platform uevent bug

Much thanks, git-applymbox'ed to battery-2.6.git. I suppose this is serious enough, thus should hit 2.6.23.

Though prior asking to pull I'll wait just a bit.

Thanks,

Signature · 4 lines
Anton Vorontsov
email: [email protected]
backup email: [email protected]
irc://irc.freenode.net/bd2