Patchwork sunvdc: Fix off-by-one in generic_request().

login
register
mail settings
Submitter David Miller
Date Feb. 14, 2013, 8:12 p.m.
Message ID <20130214.151233.851123821156758130.davem@davemloft.net>
Download mbox | patch
Permalink /patch/220493/
State Accepted
Delegated to: David Miller
Headers show

Comments

David Miller - Feb. 14, 2013, 8:12 p.m.
The 'operations' bitmap corresponds one-for-one with the operation
codes, no adjustment is necessary.

Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/block/sunvdc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
index 564156a..5814deb 100644
--- a/drivers/block/sunvdc.c
+++ b/drivers/block/sunvdc.c
@@ -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) {