Skip to content

Commit

Permalink
sunvdc: Fix off-by-one in generic_request().
Browse files Browse the repository at this point in the history
The 'operations' bitmap corresponds one-for-one with the operation
codes, no adjustment is necessary.

Reported-by: Mark Kettenis <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Feb 14, 2013
1 parent 89a7791 commit f4d9605
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/sunvdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ static int generic_request(struct vdc_port *port, u8 op, void *buf, int len)
int op_len, err;
void *req_buf;

if (!(((u64)1 << ((u64)op - 1)) & port->operations))
if (!(((u64)1 << (u64)op) & port->operations))
return -EOPNOTSUPP;

switch (op) {
Expand Down

0 comments on commit f4d9605

Please sign in to comment.