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 <segoon@openwall.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Vasiliy Kulikov 2011-01-21 16:24:23 -08:00 коммит произвёл David S. Miller
Родитель 9190b3b320
Коммит 2221eca0a2
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;
}