summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/vio.c
diff options
context:
space:
mode:
authorPrarit Bhargava <prarit@redhat.com>2013-10-17 12:00:11 (GMT)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-10-30 05:00:57 (GMT)
commit411cabf79e684171669ad29a0628c400b4431e95 (patch)
tree34cd30b8bcb83d514338998023e5582503c8a974 /arch/powerpc/kernel/vio.c
parentecb35c3943040f4db735c7d14c24ee7750cbb482 (diff)
downloadlinux-411cabf79e684171669ad29a0628c400b4431e95.tar.xz
powerpc/vio: use strcpy in modalias_show
Commit e82b89a6f19bae73fb064d1b3dd91fcefbb478f4 used strcat instead of strcpy which can result in an overflow of newlines on the buffer. Signed-off-by: Prarit Bhargava Cc: benh@kernel.crashing.org Cc: ben@decadent.org.uk Cc: stable@vger.kernel.org Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
-rw-r--r--arch/powerpc/kernel/vio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index d38cc08..cb92d82 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1531,12 +1531,12 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
dn = dev->of_node;
if (!dn) {
- strcat(buf, "\n");
+ strcpy(buf, "\n");
return strlen(buf);
}
cp = of_get_property(dn, "compatible", NULL);
if (!cp) {
- strcat(buf, "\n");
+ strcpy(buf, "\n");
return strlen(buf);
}