Skip to content

Commit 3aadbe2

Browse files
damien-lemoalmartinkpetersen
authored andcommitted
scsi: sd_zbc: Fix sd_zbc_check_zone_size() error path
If a drive with variable zone sizes or an invalid last zone size is detected, the local variable this_zone_blocks is set to 0 and early return from the function triggered, but this does not result in an error return. The local variable zone_blocks must be set to 0 for an error to be returned. [mkp: typo in commit description] Fixes: ccce20f ("scsi: sd_zbc: Avoid that resetting a zone fails sporadically") Signed-off-by: Damien Le Moal <[email protected]> Cc: Bart Van Assche <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent a0c1c18 commit 3aadbe2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/sd_zbc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ static s64 sd_zbc_check_zone_size(struct scsi_disk *sdkp)
452452
} else if (this_zone_blocks != zone_blocks &&
453453
(block + this_zone_blocks < sdkp->capacity
454454
|| this_zone_blocks > zone_blocks)) {
455-
this_zone_blocks = 0;
455+
zone_blocks = 0;
456456
goto out;
457457
}
458458
block += this_zone_blocks;

0 commit comments

Comments
 (0)