diff options
author | Martin K. Petersen <martin.petersen@ORACLE.COM> | 2010-01-20 02:17:40 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-02-19 11:14:11 -0600 |
commit | 8475f688d796b875bf98ed161acd53d00a1483ff (patch) | |
tree | 68ae880f0aab38656061981535c9c6c71f91fa98 | |
parent | 78d85019ba8c13e1094cad0ea9bb4f61caad8320 (diff) | |
download | kernel_samsung_espresso10-8475f688d796b875bf98ed161acd53d00a1483ff.zip kernel_samsung_espresso10-8475f688d796b875bf98ed161acd53d00a1483ff.tar.gz kernel_samsung_espresso10-8475f688d796b875bf98ed161acd53d00a1483ff.tar.bz2 |
[SCSI] Fix printing of variable length commands
We dereferenced the MAINTENANCE IN array when decoding variable length
commands. Use the right array. Also consolidate identical if
statements below.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/constants.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index 9129bcf..7092ff6 100644 --- a/drivers/scsi/constants.c +++ b/drivers/scsi/constants.c @@ -219,18 +219,15 @@ static void print_opcode_name(unsigned char * cdbp, int cdb_len) break; } sa = (cdbp[8] << 8) + cdbp[9]; - name = get_sa_name(maint_in_arr, MAINT_IN_SZ, sa); - if (name) { + name = get_sa_name(variable_length_arr, VARIABLE_LENGTH_SZ, sa); + if (name) printk("%s", name); - if ((cdb_len > 0) && (len != cdb_len)) - printk(", in_cdb_len=%d, ext_len=%d", - len, cdb_len); - } else { + else printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); - if ((cdb_len > 0) && (len != cdb_len)) - printk(", in_cdb_len=%d, ext_len=%d", - len, cdb_len); - } + + if ((cdb_len > 0) && (len != cdb_len)) + printk(", in_cdb_len=%d, ext_len=%d", len, cdb_len); + break; case MAINTENANCE_IN: sa = cdbp[1] & 0x1f; |