summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/exported-sql-viewer.py
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-08-12 09:22:30 -0700
committerJakub Kicinski <kuba@kernel.org>2026-08-13 17:44:54 -0700
commit77e80af7d2d4dc223716c90e9fc043bc66a8335f (patch)
tree12776391d429fbe7f318a8d5852152f6c24bd9f3 /tools/perf/scripts/python/exported-sql-viewer.py
parenta7c44619c6977fd64da99a6d1c2b73e2ad9af873 (diff)
ethtool: tsconfig: reject zero-valued tx_type and rx_filter bitsets
The ffs()/fls() guard in ethnl_set_tsconfig() was meant to enforce that the user selects exactly one tx_type (and one rx_filter) at a time (off / none are explicit types with non-zero values). However, both ffs(0) and fls(0) return 0, so the guard passes a zero-valued bitset through. The subsequent ffs(req_tx_type) - 1 would produce -1, if user selected no bit. net_hwtstamp_validate() catches the invalid -1 downstream, but returns a generic error (-ERANGE) without telling the user what went wrong. Return -EINVAL + extack instead. Replace the ffs()/fls() comparison with a hweight32() == 1 check. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Joe Damato <joe@dama.to> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Link: https://patch.msgid.link/20260812162230.1837788-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions