Skip to contentSkip to conversation

fix 2nd overflow in ak4114.c

PATCH New Darren Jenkins\ 1 participant 1 message Apr 12, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix 2nd overflow in ak4114.c

G'day list

I am sorry but I have done it again. The next coverity bug is in the same file and I didn't notice till I had sent out the first patch.

Anyway here is a separate patch for the second bug. After doing the first patch this one looks right, although I am not so sure this time.

Coverity found a static overflow in ak4114.c @ line 137.

The patch below limits the array usage to that allocated for it.

sound/i2c/other/ak4114.c renamed from sound/i2c/other/ak4114.c.orig +2 -1
@@ -134,7 +134,8 @@ void snd_ak4114_reg_write(struct ak4114 
 	if (reg <= AK4114_REG_INT1_MASK)
 		reg_write(chip, reg, (chip->regmap[reg] & ~mask) | val);
 	else if (reg >= AK4114_REG_TXCSB0 && reg <= AK4114_REG_TXCSB4)
-		reg_write(chip, reg, (chip->txcsb[reg] & ~mask) | val);
+		reg_write(chip, reg, 
+			(chip->txcsb[reg-AK4114_REG_TXCSB0] & ~mask) | val);
 }
 
 void snd_ak4114_reinit(struct ak4114 *chip)

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors