]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vdpa/mlx5: Fix incorrect error code reporting in query_virtqueues
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Mon, 29 Sep 2025 13:42:53 +0000 (06:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:24 +0000 (14:03 +0100)
commitba8a48b7be20f3818d4942b9611983a117f042b6
treea189c55ba9d504737115a315a895f6ac7a8a0bc0
parentd94497989a9ce95f71b5e1108de07c75112e8f71
vdpa/mlx5: Fix incorrect error code reporting in query_virtqueues

[ Upstream commit f0ea2e91093ac979d07ebd033e0f45869b1d2608 ]

When query_virtqueues() fails, the error log prints the variable err
instead of cmd->err. Since err may still be zero at this point, the
log message can misleadingly report a success value 0 even though the
command actually failed.

Even worse, once err is set to the first failure, subsequent logs
print that same stale value. This makes the error reporting appear
one step behind the actual failing queue index, which is confusing
and misleading.

Fix the log to report cmd->err, which reflects the real failure code
returned by the firmware.

Fixes: 1fcdf43ea69e ("vdpa/mlx5: Use async API for vq query command")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20250929134258.80956-1-alok.a.tiwari@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vdpa/mlx5/net/mlx5_vnet.c