lkml.org 
[lkml]   [2007]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[RFC: 2.6.21 patch] fix sound/pci/ice1712/wtm.c:wtm_init()
    The Coverity checker spotted this bogus for() loop that produces an 
    array overrun.

    It seems what actually should be done is quite simple?

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

    ---

    sound/pci/ice1712/wtm.c | 14 +++-----------
    1 file changed, 3 insertions(+), 11 deletions(-)

    --- linux-2.6.21-rc3-mm2/sound/pci/ice1712/wtm.c.old 2007-03-19 01:29:23.000000000 +0100
    +++ linux-2.6.21-rc3-mm2/sound/pci/ice1712/wtm.c 2007-03-19 01:33:06.000000000 +0100
    @@ -489,23 +489,15 @@

    static int __devinit wtm_init(struct snd_ice1712 *ice)
    {
    - static unsigned short stac_inits_prodigy[] = {
    - STAC946X_RESET, 0,
    - (unsigned short)-1
    - };
    - unsigned short *p;
    -
    /*WTM 192M*/
    ice->num_total_dacs = 8;
    ice->num_total_adcs = 4;
    ice->force_rdma1 = 1;

    /*initialize codec*/
    - p = stac_inits_prodigy;
    - for (; *p != (unsigned short)-1; p += 2) {
    - stac9460_put(ice, p[0], p[1]);
    - stac9460_2_put(ice, p[0], p[1]);
    - }
    + stac9460_put(ice, STAC946X_RESET, 0);
    + stac9460_2_put(ice, STAC946X_RESET, 0);
    +
    return 0;
    }

    -
    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: 2007-03-19 10:29    [W:0.021 / U:0.668 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site