• Paolo Galtieri's avatar
    [PATCH] ppc highmem fix · a0c111c6
    Paolo Galtieri authored
    I've noticed that the calculations for seg_size and nr_segs in
    __dma_sync_page_highmem() (arch/ppc/kernel/dma-mapping.c) are wrong.  The
    incorrect calculations can result in either an oops or a panic when running
    fsck depending on the size of the partition.
    
    The problem with the seg_size calculation is that it can result in a
    negative number if size is offset > size.  The problem with the nr_segs
    caculation is returns the wrong number of segments, e.g.  it returns 1 when
    size is 200 and offset is 4095, when it should return 2 or more.
    Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    a0c111c6
dma-mapping.c 10.7 KB