Skip to content

Commit 2221eca

Browse files
segoondavem330
authored andcommitted
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]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9190b3b commit 2221eca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/atm/idt77105.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static int fetch_stats(struct atm_dev *dev,struct idt77105_stats __user *arg,int
151151
spin_unlock_irqrestore(&idt77105_priv_lock, flags);
152152
if (arg == NULL)
153153
return 0;
154-
return copy_to_user(arg, &PRIV(dev)->stats,
154+
return copy_to_user(arg, &stats,
155155
sizeof(struct idt77105_stats)) ? -EFAULT : 0;
156156
}
157157

0 commit comments

Comments
 (0)