Skip to content

Commit b11344f

Browse files
aloktiwakuba-moo
authored andcommitted
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>
1 parent b52a93b commit b11344f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/google/gve/gve_adminq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ static int gve_adminq_issue_cmd(struct gve_priv *priv,
589589
break;
590590
default:
591591
dev_err(&priv->pdev->dev, "unknown AQ command opcode %d\n", opcode);
592+
return -EINVAL;
592593
}
593594

594595
return 0;

0 commit comments

Comments
 (0)