SCSI: Pass the expected opcode to scsi_cdb_unmarshall()
Pass the opcode we expect to the unmarshalling function so it can do a basic check that we are trying to unmarshalling the right kind of cdb.
This commit is contained in:
@@ -2334,8 +2334,12 @@ scsi_read10_cdb_unmarshall(struct scsi_task *task)
|
||||
}
|
||||
|
||||
void *
|
||||
scsi_cdb_unmarshall(struct scsi_task *task)
|
||||
scsi_cdb_unmarshall(struct scsi_task *task, enum scsi_opcode opcode)
|
||||
{
|
||||
if (task->cdb[0] != opcode) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch (task->cdb[0]) {
|
||||
case SCSI_OPCODE_READ10:
|
||||
return scsi_read10_cdb_unmarshall(task);
|
||||
|
||||
Reference in New Issue
Block a user