Commit 59e3da58 authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

scsi: osst: silence underflow warning in osst_verify_frame()

The code looks like this:

	i = ntohl(aux->filemark_cnt);
	if (STp->header_cache != NULL && i < OS_FM_TAB_MAX && (i > STp->filemark_cnt ||
	    STp->first_frame_position - 1 != ntohl(STp->header_cache->dat_fm_tab.fm_tab_ent[i]))) {

If i is negative then it's less than OS_FM_TAB_MAX so we read before
the start of the STp->header_cache->dat_fm_tab.fm_tab_ent[] array.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 32690e0b
...@@ -619,7 +619,7 @@ static int osst_verify_frame(struct osst_tape * STp, int frame_seq_number, int q ...@@ -619,7 +619,7 @@ static int osst_verify_frame(struct osst_tape * STp, int frame_seq_number, int q
os_aux_t * aux = STp->buffer->aux; os_aux_t * aux = STp->buffer->aux;
os_partition_t * par = &(aux->partition); os_partition_t * par = &(aux->partition);
struct st_partstat * STps = &(STp->ps[STp->partition]); struct st_partstat * STps = &(STp->ps[STp->partition]);
int blk_cnt, blk_sz, i; unsigned int blk_cnt, blk_sz, i;
if (STp->raw) { if (STp->raw) {
if (STp->buffer->syscall_result) { if (STp->buffer->syscall_result) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment