Skip to contentSkip to conversation

atm: idt77105: fix fetch_stats() result

PATCH Applied Vasiliy Kulikov 2 participants 2 messages Jan 21, 2011 – Jan 22, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atm: idt77105: fix fetch_stats() result

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.

---
 drivers/atm/idt77105.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/atm/idt77105.c +1 -1
index bca9cb8..487a547 100644
@@ -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;
 }
 
Signature · 1 line
1.7.0.4
maintainer Applied
#1 lore raw

From: Vasiliy Kulikov <[email protected]>
Date: Fri, 21 Jan 2011 12:43:07 +0300

Quoted 5 lines

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.

Applied, thanks.