From: Michal Schmidt Date: Mon, 1 Jul 2013 15:23:30 +0000 (+0200) Subject: ethtool: make .get_dump_data() harder to misuse by drivers X-Git-Tag: v3.11-rc1~64^2~50 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c590b5e2f05b5e98e614382582b7ae4cddb37599;p=pandora-kernel.git 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 Reviewed-by: Ben Hutchings Signed-off-by: David S. Miller --- Reading git-diff-tree failed