Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gve: Return error for unknown admin queue command

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>

authored by

Alok Tiwari and committed by
Jakub Kicinski
b11344f6 b52a93bb

+1
+1
drivers/net/ethernet/google/gve/gve_adminq.c
··· 589 589 break; 590 590 default: 591 591 dev_err(&priv->pdev->dev, "unknown AQ command opcode %d\n", opcode); 592 + return -EINVAL; 592 593 } 593 594 594 595 return 0;