@@ -1903,7 +1903,8 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
19031903 u32 len ;
19041904 char lu_id_str [6 ];
19051905 int host_no = devip -> sdbg_host -> shost -> host_no ;
1906-
1906+
1907+ arr [1 ] = cmd [2 ];
19071908 port_group_id = (((host_no + 1 ) & 0x7f ) << 8 ) +
19081909 (devip -> channel & 0x7f );
19091910 if (sdebug_vpd_use_hostno == 0 )
@@ -1914,7 +1915,6 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
19141915 (devip -> target * 1000 ) - 3 ;
19151916 len = scnprintf (lu_id_str , 6 , "%d" , lu_id_num );
19161917 if (0 == cmd [2 ]) { /* supported vital product data pages */
1917- arr [1 ] = cmd [2 ]; /*sanity */
19181918 n = 4 ;
19191919 arr [n ++ ] = 0x0 ; /* this page */
19201920 arr [n ++ ] = 0x80 ; /* unit serial number */
@@ -1935,23 +1935,18 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
19351935 }
19361936 arr [3 ] = n - 4 ; /* number of supported VPD pages */
19371937 } else if (0x80 == cmd [2 ]) { /* unit serial number */
1938- arr [1 ] = cmd [2 ]; /*sanity */
19391938 arr [3 ] = len ;
19401939 memcpy (& arr [4 ], lu_id_str , len );
19411940 } else if (0x83 == cmd [2 ]) { /* device identification */
1942- arr [1 ] = cmd [2 ]; /*sanity */
19431941 arr [3 ] = inquiry_vpd_83 (& arr [4 ], port_group_id ,
19441942 target_dev_id , lu_id_num ,
19451943 lu_id_str , len ,
19461944 & devip -> lu_name );
19471945 } else if (0x84 == cmd [2 ]) { /* Software interface ident. */
1948- arr [1 ] = cmd [2 ]; /*sanity */
19491946 arr [3 ] = inquiry_vpd_84 (& arr [4 ]);
19501947 } else if (0x85 == cmd [2 ]) { /* Management network addresses */
1951- arr [1 ] = cmd [2 ]; /*sanity */
19521948 arr [3 ] = inquiry_vpd_85 (& arr [4 ]);
19531949 } else if (0x86 == cmd [2 ]) { /* extended inquiry */
1954- arr [1 ] = cmd [2 ]; /*sanity */
19551950 arr [3 ] = 0x3c ; /* number of following entries */
19561951 if (sdebug_dif == T10_PI_TYPE3_PROTECTION )
19571952 arr [4 ] = 0x4 ; /* SPT: GRD_CHK:1 */
@@ -1961,30 +1956,23 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
19611956 arr [4 ] = 0x0 ; /* no protection stuff */
19621957 arr [5 ] = 0x7 ; /* head of q, ordered + simple q's */
19631958 } else if (0x87 == cmd [2 ]) { /* mode page policy */
1964- arr [1 ] = cmd [2 ]; /*sanity */
19651959 arr [3 ] = 0x8 ; /* number of following entries */
19661960 arr [4 ] = 0x2 ; /* disconnect-reconnect mp */
19671961 arr [6 ] = 0x80 ; /* mlus, shared */
19681962 arr [8 ] = 0x18 ; /* protocol specific lu */
19691963 arr [10 ] = 0x82 ; /* mlus, per initiator port */
19701964 } else if (0x88 == cmd [2 ]) { /* SCSI Ports */
1971- arr [1 ] = cmd [2 ]; /*sanity */
19721965 arr [3 ] = inquiry_vpd_88 (& arr [4 ], target_dev_id );
19731966 } else if (is_disk_zbc && 0x89 == cmd [2 ]) { /* ATA info */
1974- arr [1 ] = cmd [2 ]; /*sanity */
19751967 n = inquiry_vpd_89 (& arr [4 ]);
19761968 put_unaligned_be16 (n , arr + 2 );
19771969 } else if (is_disk_zbc && 0xb0 == cmd [2 ]) { /* Block limits */
1978- arr [1 ] = cmd [2 ]; /*sanity */
19791970 arr [3 ] = inquiry_vpd_b0 (& arr [4 ]);
19801971 } else if (is_disk_zbc && 0xb1 == cmd [2 ]) { /* Block char. */
1981- arr [1 ] = cmd [2 ]; /*sanity */
19821972 arr [3 ] = inquiry_vpd_b1 (devip , & arr [4 ]);
19831973 } else if (is_disk && 0xb2 == cmd [2 ]) { /* LB Prov. */
1984- arr [1 ] = cmd [2 ]; /*sanity */
19851974 arr [3 ] = inquiry_vpd_b2 (& arr [4 ]);
19861975 } else if (is_zbc && cmd [2 ] == 0xb6 ) { /* ZB dev. charact. */
1987- arr [1 ] = cmd [2 ]; /*sanity */
19881976 arr [3 ] = inquiry_vpd_b6 (devip , & arr [4 ]);
19891977 } else {
19901978 mk_sense_invalid_fld (scp , SDEB_IN_CDB , 2 , -1 );
0 commit comments