atm: idt77105: fix fetch_stats() result
Subsystems (4)
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.
Signed-off-by Vasiliy Kulikov <[email protected]>
--- drivers/atm/idt77105.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/atm/idt77105.c +1 -1
@@ -151,7 +151,7 @@ static int fetch_stats(struct atm_dev *dev,struct idt77105_stats __user *arg,intspin_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
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), alsomemcpy()was pointless.Signed-off-by Vasiliy Kulikov <[email protected]>
Applied, thanks.