net: netxen: correct sysfs bin attribute return code
authorVladimir Zapolskiy <vz@mleia.com>
Tue, 26 May 2015 00:50:04 +0000 (03:50 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2015 04:25:33 +0000 (00:25 -0400)
If read() syscall requests unexpected number of bytes from "dimm" binary
attribute file, return EINVAL instead of EPERM.

At the same time pin down sysfs file size to the fixed
sizeof(struct netxen_dimm_cfg), which allows to exploit some missing
sanity checks from kernfs (file boundary checks vs offset etc.)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c