]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gve: Return error for unknown admin queue command
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Mon, 16 Jun 2025 05:45:01 +0000 (22:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:18 +0000 (18:41 +0200)
commitcc749ba3d206eea8959d9ed1c4dbec2aeb1fb853
tree589b772904d86220cd6d28abb4d4afb058491492
parent15948c1617f60b899bfbaffe01782f5f97ee3916
gve: Return error for unknown admin queue command

[ Upstream commit b11344f63fdd9e8c5121148a6965b41079071dd2 ]

In gve_adminq_issue_cmd(), return -EINVAL instead of 0 when an unknown
admin queue command opcode is encountered.

This prevents the function from silently succeeding on invalid input
and prevents undefined behavior by ensuring the function fails gracefully
when an unrecognized opcode is provided.

These changes improve error handling.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Link: https://patch.msgid.link/20250616054504.1644770-2-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/google/gve/gve_adminq.c