Anton Vorontsov 18acfa2597 net/ucc_geth: Fix oops in uec_get_ethtool_stats()
p_{tx,rx}_fw_statistics_pram are special: they're available only when
a device is open. If the device is closed, we should just fill the data
with zeroes.

Fixes the following oops:

root@b1:~# ifconfig eth1 down
root@b1:~# ethtool -S eth1
Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc01e1dcc
Oops: Kernel access of bad area, sig: 11 [#1]
[...]
NIP [c01e1dcc] uec_get_ethtool_stats+0x98/0x124
LR [c0287cc8] ethtool_get_stats+0xfc/0x23c
Call Trace:
[cfaadde0] [c0287ca8] ethtool_get_stats+0xdc/0x23c (unreliable)
[cfaade20] [c0288340] dev_ethtool+0x2fc/0x588
[cfaade50] [c0285648] dev_ioctl+0x290/0x33c
[cfaadea0] [c0272238] sock_ioctl+0x80/0x2ec
[cfaadec0] [c00b5ae4] vfs_ioctl+0x40/0xc0
[cfaadee0] [c00b5fa8] do_vfs_ioctl+0x78/0x20c
[cfaadf10] [c00b617c] sys_ioctl+0x40/0x74
[cfaadf40] [c00142d8] ret_from_syscall+0x0/0x38
[...]
---[ end trace b941007b2dfb9759 ]---
Segmentation fault

p.s. While at it, also remove u64 casts, they aren't needed.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-11-14 18:18:17 -05:00
..
2008-11-04 08:18:19 -08:00
2008-10-31 00:46:34 -04:00
2008-11-03 15:23:02 -05:00
2008-10-16 16:52:05 +02:00
2008-10-08 16:53:40 -07:00
2008-10-16 16:52:05 +02:00
2008-06-10 18:20:17 -04:00
2008-08-14 04:26:38 -04:00
2008-10-12 21:15:17 -07:00
2008-07-18 17:54:17 -07:00
2008-10-09 12:22:38 -07:00
2008-10-09 12:26:41 -07:00
2008-08-13 16:05:38 -07:00
2008-08-13 16:05:37 -07:00
2008-08-13 16:05:37 -07:00
2008-11-03 16:46:58 -08:00
2008-08-13 16:05:37 -07:00
2008-09-03 14:38:00 -07:00
2008-09-22 19:27:10 -07:00
2008-09-22 19:27:10 -07:00
2008-03-26 00:18:43 -04:00
2008-10-08 17:09:54 -07:00
2008-05-22 14:12:40 -04:00
2008-09-16 19:35:05 -07:00
2008-07-22 17:50:44 -04:00
2008-08-27 05:36:57 -04:00
2008-07-25 15:44:44 +10:00
2008-08-14 04:26:38 -04:00
2008-10-08 19:51:33 -07:00
2008-11-03 15:23:12 -05:00
2008-04-25 02:08:51 -04:00
2008-10-08 17:09:54 -07:00
2008-07-22 17:50:44 -04:00
2008-03-26 00:18:00 -04:00
2008-05-30 22:19:22 -04:00
2008-07-20 17:12:34 -07:00
2008-07-20 17:12:34 -07:00
2008-10-30 23:35:02 -07:00
2008-10-17 02:38:35 +11:00
2008-08-07 02:11:15 -04:00
2008-04-16 20:41:44 -04:00
2008-05-30 22:07:17 -04:00
2008-08-07 02:20:57 -04:00
2008-10-12 20:59:48 -07:00
2008-08-07 01:55:50 -04:00
2008-07-20 17:12:34 -07:00
2008-10-22 06:22:13 -04:00
2008-04-16 20:06:50 -04:00
2008-08-29 02:13:33 -07:00
2008-08-29 02:14:29 -07:00
2008-08-31 20:59:37 -07:00
2008-08-29 02:14:43 -07:00
2008-10-12 21:01:53 -07:00
2008-05-30 22:18:02 -04:00
2008-11-01 09:49:46 -07:00