diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index f073630dd..656780927 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -1824,17 +1824,18 @@ static vdisk_op_fn nullio_ops[256] = { SHARED_OPS }; +#define VDISK_OPCODE_DESCRIPTORS \ + /* &scst_op_descr_get_lba_status, */ \ + &scst_op_descr_read_capacity16, \ + &scst_op_descr_write_same10, \ + &scst_op_descr_write_same16, \ + &scst_op_descr_unmap, \ + &scst_op_descr_format_unit, \ + &scst_op_descr_cwr, + static const struct scst_opcode_descriptor *vdisk_opcode_descriptors[] = { SHARED_OPCODE_DESCRIPTORS -#if 0 /* it's INVALID OPCODE currently */ - &scst_op_descr_get_lba_status, -#endif - &scst_op_descr_read_capacity16, - &scst_op_descr_write_same10, - &scst_op_descr_write_same16, - &scst_op_descr_unmap, - &scst_op_descr_format_unit, - &scst_op_descr_cwr, + VDISK_OPCODE_DESCRIPTORS SCST_OPCODE_DESCRIPTORS }; diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 2f824abeb..9090509d7 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -2229,7 +2229,7 @@ static int scst_report_supported_opcodes(struct scst_cmd *cmd) buf = address; inline_buf = true; } else { - buf = vzalloc(buf_len); /* it can be big */ + buf = vmalloc(buf_len); /* it can be big */ if (buf == NULL) { PRINT_ERROR("Unable to allocate REPORT SUPPORTED " "OPERATION CODES buffer with size %d", buf_len); @@ -2239,7 +2239,7 @@ static int scst_report_supported_opcodes(struct scst_cmd *cmd) inline_buf = false; } - memset(buf, 0, sizeof(buf)); + memset(buf, 0, buf_len); switch(options) { case 0: /* all */