Skip to content

Commit

Permalink
ASoC: wm9090: fix DB_RANGE size
Browse files Browse the repository at this point in the history
Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the arrays.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
  • Loading branch information
Clemens Ladisch committed Nov 20, 2011
1 parent dac678f commit a1320fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/soc/codecs/wm9090.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,19 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec)
}

static const unsigned int in_tlv[] = {
TLV_DB_RANGE_HEAD(6),
TLV_DB_RANGE_HEAD(3),
0, 0, TLV_DB_SCALE_ITEM(-600, 0, 0),
1, 3, TLV_DB_SCALE_ITEM(-350, 350, 0),
4, 6, TLV_DB_SCALE_ITEM(600, 600, 0),
};
static const unsigned int mix_tlv[] = {
TLV_DB_RANGE_HEAD(4),
TLV_DB_RANGE_HEAD(2),
0, 2, TLV_DB_SCALE_ITEM(-1200, 300, 0),
3, 3, TLV_DB_SCALE_ITEM(0, 0, 0),
};
static const DECLARE_TLV_DB_SCALE(out_tlv, -5700, 100, 0);
static const unsigned int spkboost_tlv[] = {
TLV_DB_RANGE_HEAD(7),
TLV_DB_RANGE_HEAD(2),
0, 6, TLV_DB_SCALE_ITEM(0, 150, 0),
7, 7, TLV_DB_SCALE_ITEM(1200, 0, 0),
};
Expand Down

0 comments on commit a1320fe

Please sign in to comment.