All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap: debugfs: Fix reading in register field units
@ 2013-02-07 10:51 Dimitris Papastamos
  2013-02-08 11:32 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dimitris Papastamos @ 2013-02-07 10:51 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, patches

At the moment, if the length of the register field format is
N bytes, we can only get anything meaningful back to userspace
by providing a buffer that is N + 2 bytes large.  Fix this
so we that we only need to provide a buffer of N bytes.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 drivers/base/regmap/regmap-debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 0445f2f..96990d2 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -187,7 +187,7 @@ static ssize_t regmap_map_read_file(struct file *file, char __user *user_buf,
 		/* If we're in the region the user is trying to read */
 		if (p >= *ppos) {
 			/* ...but not beyond it */
-			if (buf_pos + 1 + map->debugfs_tot_len >= count)
+			if (buf_pos + map->debugfs_tot_len > count)
 				break;
 
 			/* Format the register */
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regmap: debugfs: Fix reading in register field units
  2013-02-07 10:51 [PATCH] regmap: debugfs: Fix reading in register field units Dimitris Papastamos
@ 2013-02-08 11:32 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-02-08 11:32 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: linux-kernel, patches

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

On Thu, Feb 07, 2013 at 10:51:56AM +0000, Dimitris Papastamos wrote:
> At the moment, if the length of the register field format is
> N bytes, we can only get anything meaningful back to userspace
> by providing a buffer that is N + 2 bytes large.  Fix this
> so we that we only need to provide a buffer of N bytes.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-08 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-07 10:51 [PATCH] regmap: debugfs: Fix reading in register field units Dimitris Papastamos
2013-02-08 11:32 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.