kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [KJ][patch] fix array overflow in ak4114.c
@ 2006-04-12 13:37 Darren Jenkins\
  2006-04-13 10:29 ` Jean Delvare
  0 siblings, 1 reply; 2+ messages in thread
From: Darren Jenkins\ @ 2006-04-12 13:37 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]

G'day list

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

After looking at this a little it seems like someone has typed in the
wrong symbolic name (twice), as they were trying to save the TX state
register info.


The patch below changes the relevant AK4114_REG_RXCSB0 values to
AK4114_REG_TXCSB0. Which both makes more sense and fixes the array
overflow.


Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>

--- 2.6.17-rc1-git5/sound/i2c/other/ak4114.c.orig	2006-04-12 23:12:43.000000000 +1000
+++ 2.6.17-rc1-git5/sound/i2c/other/ak4114.c	2006-04-12 23:16:56.000000000 +1000
@@ -42,8 +42,8 @@ static void reg_write(struct ak4114 *ak4
 	ak4114->write(ak4114->private_data, reg, val);
 	if (reg <= AK4114_REG_INT1_MASK)
 		ak4114->regmap[reg] = val;
-	else if (reg >= AK4114_REG_RXCSB0 && reg <= AK4114_REG_TXCSB4)
-		ak4114->txcsb[reg-AK4114_REG_RXCSB0] = val;
+	else if (reg >= AK4114_REG_TXCSB0 && reg <= AK4114_REG_TXCSB4)
+		ak4114->txcsb[reg-AK4114_REG_TXCSB0] = val;
 }
 
 static inline unsigned char reg_read(struct ak4114 *ak4114, unsigned char reg)



[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [KJ][patch] fix array overflow in ak4114.c
  2006-04-12 13:37 [KJ][patch] fix array overflow in ak4114.c Darren Jenkins\
@ 2006-04-13 10:29 ` Jean Delvare
  0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2006-04-13 10:29 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 812 bytes --]

Hi Darren,

> Coverity found a static overflow in ak4114.c @ line 46.
> 
> After looking at this a little it seems like someone has typed in the
> wrong symbolic name (twice), as they were trying to save the TX state
> register info.
> 
> The patch below changes the relevant AK4114_REG_RXCSB0 values to
> AK4114_REG_TXCSB0. Which both makes more sense and fixes the array
> overflow.
> (...)
> --- 2.6.17-rc1-git5/sound/i2c/other/ak4114.c.orig	2006-04-12 23:12:43.000000000 +1000
> +++ 2.6.17-rc1-git5/sound/i2c/other/ak4114.c	2006-04-12 23:16:56.000000000 +1000

I'm not maintaining the sound drivers, so please don't Cc: me on this.
The only case where I would be able (and willing) to help is when a bug
actually involves the i2c part of a driver. Doesn't seem to be the case
here.

Thanks,
-- 
Jean Delvare

[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-13 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-12 13:37 [KJ][patch] fix array overflow in ak4114.c Darren Jenkins\
2006-04-13 10:29 ` Jean Delvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).