aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-26 12:16:21 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-26 12:16:21 -0400
commit5309809129ca3ab14f8bd5e5ef66c1b7686eb639 (patch)
tree7b96c3203759b5efd45ede9020585cf113ab4c18 /drivers/base
parent544002ef832730b18327000c898a140bfc93efd4 (diff)
Add explicit zeroing to "envp" array in device 'show' method
As Stephen Hemminger says, this is a "belt and suspenders" patch that zeroes the envp array at allocation time, even though all the users should NULL-terminate it anyway (and we've hopefully fixed everybody that doesn't do that). And we'll apparently clean the whole envp thing up for 2.6.24 anyway. But let's just be robust, and do both this *and* make sure that all users are doing the right thing. Acked-by: Stephen Hemminger <shemminger@linux-foundation.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 6de33d7a29ba..67c92582d6ef 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -284,6 +284,7 @@ static ssize_t show_uevent(struct device *dev, struct device_attribute *attr,
284 284
285 /* let the kset specific function add its keys */ 285 /* let the kset specific function add its keys */
286 pos = data; 286 pos = data;
287 memset(envp, 0, sizeof(envp));
287 retval = kset->uevent_ops->uevent(kset, &dev->kobj, 288 retval = kset->uevent_ops->uevent(kset, &dev->kobj,
288 envp, ARRAY_SIZE(envp), 289 envp, ARRAY_SIZE(envp),
289 pos, PAGE_SIZE); 290 pos, PAGE_SIZE);