]> Zhao Yanbai Git Server - minix.git/commitdiff
ahci: fix integer sign extension bug 57/1057/1
authorDavid van Moolenbroek <david@minix3.org>
Tue, 22 Oct 2013 13:58:59 +0000 (13:58 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Tue, 22 Oct 2013 13:58:59 +0000 (13:58 +0000)
Reported by Coverity.

Change-Id: Ie7eef9570c89c69a05ba45169a0ea838f0d8e320

drivers/ahci/ahci.c

index 2ef4dfb7e5bd648b271533bf7fcb089d3a64db04..1c7282622d17b17e043b9a3dbb76c39bb1a1a0ac 100644 (file)
@@ -559,7 +559,8 @@ static int ata_id_check(struct port_state *ps, u16_t *buf)
        /* Get number of LBA blocks, and sector size. */
        ps->lba_count = ((u64_t) buf[ATA_ID_LBA3] << 48) |
                        ((u64_t) buf[ATA_ID_LBA2] << 32) |
-                       (buf[ATA_ID_LBA1] << 16) | buf[ATA_ID_LBA0];
+                       ((u64_t) buf[ATA_ID_LBA1] << 16) |
+                        (u64_t) buf[ATA_ID_LBA0];
 
        /* Determine the queue depth of the device. */
        if (hba_state.has_ncq &&