lkml.org 
[lkml]   [2006]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[2.6 patch] sound/pci/rme9652/hdspm.c: fix off-by-one errors
    This patch fixes off-by-one errors found by the Coverity checker.


    Signed-off-by: Adrian Bunk <bunk@stusta.de>

    --- linux-2.6.16-rc5-mm3-full/sound/pci/rme9652/hdspm.c.old 2006-03-11 03:11:15.000000000 +0100
    +++ linux-2.6.16-rc5-mm3-full/sound/pci/rme9652/hdspm.c 2006-03-11 03:12:10.000000000 +0100
    @@ -474,7 +474,7 @@
    static inline int hdspm_read_in_gain(struct hdspm * hdspm, unsigned int chan,
    unsigned int in)
    {
    - if (chan > HDSPM_MIXER_CHANNELS || in > HDSPM_MIXER_CHANNELS)
    + if (chan >= HDSPM_MIXER_CHANNELS || in >= HDSPM_MIXER_CHANNELS)
    return 0;

    return hdspm->mixer->ch[chan].in[in];
    @@ -483,7 +483,7 @@
    static inline int hdspm_read_pb_gain(struct hdspm * hdspm, unsigned int chan,
    unsigned int pb)
    {
    - if (chan > HDSPM_MIXER_CHANNELS || pb > HDSPM_MIXER_CHANNELS)
    + if (chan >= HDSPM_MIXER_CHANNELS || pb >= HDSPM_MIXER_CHANNELS)
    return 0;
    return hdspm->mixer->ch[chan].pb[pb];
    }
    -
    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: 2006-03-11 04:47    [W:0.020 / U:0.680 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site