lkml.org 
[lkml]   [2011]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 1/2] ASoC: Add BUG() assertion if max98088_get_channel returns -EINVAL
    From
    Date
    The callers use the return value of max98088_get_channel as array index to
    access max98088->dai[] array.
    Add BUG() assertion for out of bound access of max98088->dai[] array.

    Signed-off-by: Axel Lin <axel.lin@gmail.com>
    ---
    sound/soc/codecs/max98088.c | 1 +
    1 files changed, 1 insertions(+), 0 deletions(-)

    diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
    index ac65a2d..aaca91c 100644
    --- a/sound/soc/codecs/max98088.c
    +++ b/sound/soc/codecs/max98088.c
    @@ -1703,6 +1703,7 @@ static int max98088_get_channel(const char *name)
    return 0;
    if (strcmp(name, "EQ2 Mode") == 0)
    return 1;
    + BUG();
    return -EINVAL;
    }

    --
    1.7.4.1




    \
     
     \ /
      Last update: 2011-09-28 16:03    [W:0.019 / U:30.732 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site