[SCSI] libsrp: fix bug in ADDITIONAL CDB LENGTH interpretation
authorBart Van Assche <bart.vanassche@gmail.com>
Wed, 9 Dec 2009 18:52:19 +0000 (19:52 +0100)
committerJames Bottomley <James.Bottomley@suse.de>
Fri, 19 Feb 2010 17:11:07 +0000 (11:11 -0600)
commit78d85019ba8c13e1094cad0ea9bb4f61caad8320
tree354b5a78854011757aef654080d8db3c72bbdb13
parent22963a37b3437a25812cc856afa5a84ad4a3f541
[SCSI] libsrp: fix bug in ADDITIONAL CDB LENGTH interpretation

Fix a bug in the interpretation of the ADDITIONAL CDB LENGTH (add_cdb_len)
field of SRP_CMD requests. According to the SRP specification, the layout
of this single-byte field is as follows:
* Bits 0 and 1 are reserved.
* Bits 2 to 7 represent the ADDITIONAL CDB LENGTH field, symbolically
  represented as n.
* Still according to the SRP specification, the ADDITIONAL CDB section
  takes 4*n bytes.

Currently libsrp is only used by the ibmvscsi driver. Since the ibmvscsi
driver doesn't support large CDB's, this bug hasn't caused any problems yet.

[jejb: use & ~3 to mask the bits]
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/libsrp.c