]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/libata-core.c
libata: Avoid overflow in ata_tf_to_lba48() when tf->hba_lbal > 127
[linux-2.6-omap-h63xx.git] / drivers / ata / libata-core.c
index e398df12fd18a2838363ca5144ae16b3fdc28860..8824c8da3f2f88abea82ab1de951313ef811bf76 100644 (file)
@@ -1268,7 +1268,7 @@ u64 ata_tf_to_lba48(const struct ata_taskfile *tf)
 
        sectors |= ((u64)(tf->hob_lbah & 0xff)) << 40;
        sectors |= ((u64)(tf->hob_lbam & 0xff)) << 32;
-       sectors |= (tf->hob_lbal & 0xff) << 24;
+       sectors |= ((u64)(tf->hob_lbal & 0xff)) << 24;
        sectors |= (tf->lbah & 0xff) << 16;
        sectors |= (tf->lbam & 0xff) << 8;
        sectors |= (tf->lbal & 0xff);