Skip to content

Commit

Permalink
atm: idt77105: fix fetch_stats() result
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vasiliy Kulikov authored and David S. Miller committed Jan 22, 2011
1 parent 9190b3b commit 2221eca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/atm/idt77105.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2221eca

Please sign in to comment.