summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKarsten Keil <keil@b1-systems.de>2009-06-02 15:37:37 +0200
committerKarsten Keil <keil@b1-systems.de>2009-06-11 19:04:54 +0200
commit1ce1513f48e3bc4d55ee672f0e39f5063a02ab7a (patch)
tree1428894cade512b477dcd0ba9641e36faa7cb085 /drivers
parent8a745b9d91962991ce87a649a4dc3af3206c2c8b (diff)
downloadlinux-1ce1513f48e3bc4d55ee672f0e39f5063a02ab7a.tar.bz2
mISDN: Fix overlapping data access
Remove code rewriting a buffer by itself. This fix bug 12970 on bugzilla.kernel.org. Signed-off-by: Karsten Keil <keil@b1-systems.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/isdn/mISDN/dsp_pipeline.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/isdn/mISDN/dsp_pipeline.c b/drivers/isdn/mISDN/dsp_pipeline.c
index ac61f198eb32..e9941678edfa 100644
--- a/drivers/isdn/mISDN/dsp_pipeline.c
+++ b/drivers/isdn/mISDN/dsp_pipeline.c
@@ -55,20 +55,19 @@ static ssize_t
attr_show_args(struct device *dev, struct device_attribute *attr, char *buf)
{
struct mISDN_dsp_element *elem = dev_get_drvdata(dev);
- ssize_t len = 0;
- int i = 0;
+ int i;
+ char *p = buf;
*buf = 0;
- for (; i < elem->num_args; ++i)
- len = sprintf(buf, "%sName: %s\n%s%s%sDescription: %s\n"
- "\n", buf,
+ for (i = 0; i < elem->num_args; i++)
+ p += sprintf(p, "Name: %s\n%s%s%sDescription: %s\n\n",
elem->args[i].name,
elem->args[i].def ? "Default: " : "",
elem->args[i].def ? elem->args[i].def : "",
elem->args[i].def ? "\n" : "",
elem->args[i].desc);
- return len;
+ return p - buf;
}
static struct device_attribute element_attributes[] = {