]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/staging/rts_pstor/ms.c
Staging: rts_pstor: off by one in for loop
[mirror_ubuntu-bionic-kernel.git] / drivers / staging / rts_pstor / ms.c
index 66341dff8c99160e54c29dcdb45dabdb9a11c3f4..f9a4498984cc005f516a998a06bb061d2b9dcc8c 100644 (file)
@@ -3498,7 +3498,8 @@ static int ms_rw_multi_sector(struct scsi_cmnd *srb, struct rtsx_chip *chip, u32
 
                log_blk++;
 
-               for (seg_no = 0; seg_no < sizeof(ms_start_idx)/2; seg_no++) {
+               for (seg_no = 0; seg_no < ARRAY_SIZE(ms_start_idx) - 1;
+                               seg_no++) {
                        if (log_blk < ms_start_idx[seg_no+1])
                                break;
                }