lkml.org 
[lkml]   [2001]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] make i810_audio GETOSPACE consistent with i810_write()
    Hi,

    This fixes a bug in i810_ioctl(), which made the GETOSPACE ioctl return
    a different value than that checked against in i810_write.

    >From i810_write():
    | cnt = dmabuf->dmasize - dmabuf->fragsize - dmabuf->count;
    | // this is to make the copy_from_user simpler below
    | if(cnt > (dmabuf->dmasize - swptr))
    | cnt = dmabuf->dmasize - swptr;
    | spin_unlock_irqrestore(&state->card->lock, flags);
    |
    |#ifdef DEBUG2
    | printk(KERN_INFO "i810_audio: i810_write: %d bytes available spa
    |ce\n", cnt);
    |#endif

    where cnt is the space available.

    Please apply


    --- linux-2.4.10-ac12/drivers/sound/i810_audio.c Wed Nov 7 19:15:31 2001
    +++ linux-2.4.10-ifia/drivers/sound/i810_audio.c Wed Nov 7 19:02:10 2001
    @@ -1860,7 +1860,7 @@
    if(dmabuf->mapped)
    abinfo.bytes = dmabuf->count;
    else
    - abinfo.bytes = dmabuf->dmasize - dmabuf->count;
    + abinfo.bytes = dmabuf->dmasize - dmabuf->fragsize - dmabuf->count;
    abinfo.fragments = abinfo.bytes / dmabuf->userfragsize;
    spin_unlock_irqrestore(&state->card->lock, flags);
    #ifdef DEBUG
    --
    Tobias PGP: 0x9AC7E0BC
    Hannover Fantreffen ML: mailto:fantreffen-request@mantrha.de?subject=subscribe
    Manga & Anime Treff Hannover: http://www.mantrha.de/
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:12    [W:2.710 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site