Commit 411cabf7 authored by Prarit Bhargava's avatar Prarit Bhargava Committed by Benjamin Herrenschmidt

powerpc/vio: use strcpy in modalias_show

Commit e82b89a6 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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent ecb35c39
...@@ -1531,12 +1531,12 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, ...@@ -1531,12 +1531,12 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
dn = dev->of_node; dn = dev->of_node;
if (!dn) { if (!dn) {
strcat(buf, "\n"); strcpy(buf, "\n");
return strlen(buf); return strlen(buf);
} }
cp = of_get_property(dn, "compatible", NULL); cp = of_get_property(dn, "compatible", NULL);
if (!cp) { if (!cp) {
strcat(buf, "\n"); strcpy(buf, "\n");
return strlen(buf); return strlen(buf);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment