summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2012-07-13 09:55:29 -0700
committerBen Hutchings <bhutchings@solarflare.com>2012-07-16 21:23:35 +0100
commitb17dcb99726427b6f7a26be8c46023c5d7d15e08 (patch)
treed2b11903305b270a9103f2c45615e52662d7fbd8
parentddb63dfb98296d01f5c06058d975d54939704f56 (diff)
downloadethtool-b17dcb99726427b6f7a26be8c46023c5d7d15e08.tar.gz
ethtool: Resolve use of uninitialized memory in rxclass_get_dev_info
The ethtool function for getting the rule count was not zeroing out the data field before passing it to the kernel. As a result the value started uninitialized and was incorrectly returning a result indicating that devices supported setting new rule indexes. In order to correct this I am adding a one line fix that sets data to zero before we pass the command to the kernel. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--rxclass.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/rxclass.c b/rxclass.c
index 4d49aa6..e1633a8 100644
--- a/rxclass.c
+++ b/rxclass.c
@@ -207,6 +207,7 @@ static int rxclass_get_dev_info(struct cmd_context *ctx, __u32 *count,
int err;
nfccmd.cmd = ETHTOOL_GRXCLSRLCNT;
+ nfccmd.data = 0;
err = send_ioctl(ctx, &nfccmd);
*count = nfccmd.rule_cnt;
if (driver_select)