diff options
| author | Alexey Kodanev <aleksei.kodanev@bell-sw.com> | 2026-04-22 16:05:36 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-04-23 11:01:20 -0700 |
| commit | 4078c5611d7585548b249377ebd60c272e410490 (patch) | |
| tree | 1aa13220063af2720967ca052b3a41eed29a1327 /include/linux/timerqueue.h | |
| parent | 5a8db80f721deee8e916c2cfdee78decda02ce4f (diff) | |
nfp: fix swapped arguments in nfp_encode_basic_qdr() calls
There is a mismatch between the passed arguments and the actual
nfp_encode_basic_qdr() function parameter names:
static int nfp_encode_basic_qdr(u64 addr, int dest_island, int cpp_tgt,
int mode, bool addr40, int isld1,
int isld0)
{
...
But "dest_island" and "cpp_tgt" are swapped at every call-site.
For example:
return nfp_encode_basic_qdr(*addr, cpp_tgt, dest_island,
mode, addr40, isld1, isld0);
As a result, nfp_encode_basic_qdr() receives "dest_island" as CPP target
type, which is always NFP_CPP_TARGET_QDR(2) for these calls, and "cpp_tgt"
as the destination island ID, which can accidentally match or be outside
the valid NFP_CPP_TARGET_* types (e.g. '-1' for any destination).
Since code already worked for years, also add extra pr_warn() to error
paths in nfp_encode_basic_qdr() to help identify any potential address
verification failures.
Detected using the static analysis tool - Svace.
Fixes: 4cb584e0ee7d ("nfp: add CPP access core")
Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
Link: https://patch.msgid.link/20260422160536.61855-1-aleksei.kodanev@bell-sw.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
