[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100903124105.GJ5437@bicker>
Date: Fri, 3 Sep 2010 14:41:06 +0200
From: Dan Carpenter <error27@...il.com>
To: "Rafael J. Wysocki" <rjw@...k.pl>
Cc: mark gross <markgross@...gnar.org>,
James Bottomley <James.Bottomley@...e.de>,
Frederic Weisbecker <fweisbec@...il.com>,
Jonathan Corbet <corbet@....net>, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] pm_qos_params: cleanup: terminate a string
This is just a picky thing, but we pass an possibly unterminated string
to printk if debugging is turned on. Also printk level is set to
"debug" by pr_debug() so the "KERN_ERR" isn't used.
Signed-off-by: Dan Carpenter <error27@...il.com>
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index b7e4c36..310a51e 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -389,10 +389,11 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
} else if (count == 11) { /* len('0x12345678/0') */
if (copy_from_user(ascii_value, buf, 11))
return -EFAULT;
+ ascii_value[10] = '\0';
x = sscanf(ascii_value, "%x", &value);
if (x != 1)
return -EINVAL;
- pr_debug(KERN_ERR "%s, %d, 0x%x\n", ascii_value, x, value);
+ pr_debug("%s, %d, 0x%x\n", ascii_value, x, value);
} else
return -EINVAL;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists