diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2012-07-13 09:55:29 -0700 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-07-16 21:23:35 +0100 |
commit | b17dcb99726427b6f7a26be8c46023c5d7d15e08 (patch) | |
tree | d2b11903305b270a9103f2c45615e52662d7fbd8 | |
parent | ddb63dfb98296d01f5c06058d975d54939704f56 (diff) | |
download | ethtool-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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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) |