All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] atm: idt77105: fix fetch_stats() result
@ 2011-01-21  9:43 ` Vasiliy Kulikov
  0 siblings, 0 replies; 4+ messages in thread
From: Vasiliy Kulikov @ 2011-01-21  9:43 UTC (permalink / raw)
  To: kernel-janitors; +Cc: Chas Williams, linux-atm-general, netdev, linux-kernel

copy_to_user() used PRIV(dev)->stats instead of local stats variable.
Zero stats were returned to user in case of (zero != 0), also memcpy()
was pointless.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
---
 drivers/atm/idt77105.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
index bca9cb8..487a547 100644
--- a/drivers/atm/idt77105.c
+++ b/drivers/atm/idt77105.c
@@ -151,7 +151,7 @@ static int fetch_stats(struct atm_dev *dev,struct idt77105_stats __user *arg,int
 	spin_unlock_irqrestore(&idt77105_priv_lock, flags);
 	if (arg == NULL)
 		return 0;
-	return copy_to_user(arg, &PRIV(dev)->stats,
+	return copy_to_user(arg, &stats,
 		    sizeof(struct idt77105_stats)) ? -EFAULT : 0;
 }
 
-- 
1.7.0.4


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

* [PATCH] atm: idt77105: fix fetch_stats() result
@ 2011-01-21  9:43 ` Vasiliy Kulikov
  0 siblings, 0 replies; 4+ messages in thread
From: Vasiliy Kulikov @ 2011-01-21  9:43 UTC (permalink / raw)
  To: kernel-janitors; +Cc: Chas Williams, linux-atm-general, netdev, linux-kernel

copy_to_user() used PRIV(dev)->stats instead of local stats variable.
Zero stats were returned to user in case of (zero != 0), also memcpy()
was pointless.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
---
 drivers/atm/idt77105.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
index bca9cb8..487a547 100644
--- a/drivers/atm/idt77105.c
+++ b/drivers/atm/idt77105.c
@@ -151,7 +151,7 @@ static int fetch_stats(struct atm_dev *dev,struct idt77105_stats __user *arg,int
 	spin_unlock_irqrestore(&idt77105_priv_lock, flags);
 	if (arg = NULL)
 		return 0;
-	return copy_to_user(arg, &PRIV(dev)->stats,
+	return copy_to_user(arg, &stats,
 		    sizeof(struct idt77105_stats)) ? -EFAULT : 0;
 }
 
-- 
1.7.0.4


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

* Re: [PATCH] atm: idt77105: fix fetch_stats() result
  2011-01-21  9:43 ` Vasiliy Kulikov
@ 2011-01-22  0:24   ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2011-01-22  0:24 UTC (permalink / raw)
  To: segoon; +Cc: kernel-janitors, chas, linux-atm-general, netdev, linux-kernel

From: Vasiliy Kulikov <segoon@openwall.com>
Date: Fri, 21 Jan 2011 12:43:07 +0300

> copy_to_user() used PRIV(dev)->stats instead of local stats variable.
> Zero stats were returned to user in case of (zero != 0), also memcpy()
> was pointless.
> 
> Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>

Applied, thanks.

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

* Re: [PATCH] atm: idt77105: fix fetch_stats() result
@ 2011-01-22  0:24   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2011-01-22  0:24 UTC (permalink / raw)
  To: segoon; +Cc: kernel-janitors, chas, linux-atm-general, netdev, linux-kernel

From: Vasiliy Kulikov <segoon@openwall.com>
Date: Fri, 21 Jan 2011 12:43:07 +0300

> copy_to_user() used PRIV(dev)->stats instead of local stats variable.
> Zero stats were returned to user in case of (zero != 0), also memcpy()
> was pointless.
> 
> Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>

Applied, thanks.

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

end of thread, other threads:[~2011-01-22  0:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-21  9:43 [PATCH] atm: idt77105: fix fetch_stats() result Vasiliy Kulikov
2011-01-21  9:43 ` Vasiliy Kulikov
2011-01-22  0:24 ` David Miller
2011-01-22  0:24   ` David Miller

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.