ethtool: make .get_dump_data() harder to misuse by drivers
ethtool: make .get_dump_data() harder to misuse by drivers

As the patch "bnx2x: remove zeroing of dump data buffer" showed,
it is too easy implement .get_dump_data incorrectly in a driver.

Let's make sure drivers cannot get confused by userspace requesting
a too big dump.

Also WARN if the driver sets dump->len to something weird and make
sure the length reported to userspace is the actual length of data
copied to userspace.

Signed-off-by: Michal Schmidt <b2f54855ee5c6e19cecf0e24bef2348da08eb16e@redhat.com>
Reviewed-by: Ben Hutchings <73675debcd8a436be48ec22211dcf44fe0df0a64@decadent.org.uk>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs