android_kernel_xiaomi_sm8350/drivers/isdn/hardware/eicon
Ian Munsie 8b4017d8c1 i4l: silence compiler warnings for array access in Eicon DIVA ISDN driver
When compiling this driver, the compiler throws the following warnings:

drivers/isdn/hardware/eicon/message.c:8426: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8427: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8434: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8435: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8436: warning: array subscript is above array bounds
drivers/isdn/hardware/eicon/message.c:8447: warning: array subscript is above array bounds

This arises from the particular semantics the driver is using to write to
the nlc array (static byte[256]).  The array has a length in byte 0
followed by a T30_INFO struct starting at byte 1.

The T30_INFO struct has a number of variable length strings after the
station_id entry, which cannot be explicitly defined in the struct and the
driver accesses them with an array index to station_id beyond the length
of station_id.

This patch merely changes the semantics that the driver uses to access the
entries after the station_id entry to use the original 256 byte nlc array
taking the offset and length of the station_id entry to calculate where to
write in the array, thereby silencing the warning.

Signed-off-by: Ian Munsie <imunsie@au.ibm.com>
Cc: Armin Schindler <mac@melware.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Stoyan Gaydarov <sgayda2@uiuc.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-15 15:47:02 -07:00
..
adapter.h
capi20.h
capidtmf.c
capidtmf.h
capifunc.c
capifunc.h
capimain.c proc_fops: convert drivers/isdn/ to seq_file 2010-01-14 03:10:54 -08:00
cardtype.h
cp_vers.h
dadapter.c
dadapter.h
debug_if.h
debug.c drivers/isdn/hardware/icon: fix sparse warning: cast truncates bits 2009-02-27 01:00:42 -08:00
debuglib.c
debuglib.h fix similar typos to successfull 2009-01-08 08:31:15 -08:00
dfifo.h
di_dbg.h
di_defs.h
di.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
di.h
did_vers.h
diddfunc.c
diva_didd.c proc_fops: convert drivers/isdn/ to seq_file 2010-01-14 03:10:54 -08:00
diva_dma.c
diva_dma.h
diva_pci.h
diva.c
diva.h
divacapi.h
divamnt.c divamnt: BKL pushdown 2008-06-20 14:05:52 -06:00
divasfunc.c
divasi.c proc_fops: convert drivers/isdn/ to seq_file 2010-01-14 03:10:54 -08:00
divasmain.c Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
divasproc.c proc_fops: convert drivers/isdn/ to seq_file 2010-01-14 03:10:54 -08:00
divasync.h
dqueue.c
dqueue.h
dsp_defs.h
dsp_tst.h
dspdids.h
dsrv4bri.h
dsrv_bri.h
dsrv_pri.h
entity.h
helpers.h
idifunc.c
io.c
io.h
istream.c
Kconfig
kst_ifc.h
maintidi.c Merge branch 'for-next' into for-linus 2009-12-07 18:36:35 +01:00
maintidi.h
Makefile
man_defs.h
mdm_msg.h
message.c i4l: silence compiler warnings for array access in Eicon DIVA ISDN driver 2010-03-15 15:47:02 -07:00
mi_pc.h
mntfunc.c
os_4bri.c ISDN: ARRAY_SIZE changes 2009-07-25 20:23:05 +02:00
os_4bri.h
os_bri.c fix similar typos to successfull 2009-01-08 08:31:15 -08:00
os_bri.h
os_capi.h
os_pri.c fix similar typos to successfull 2009-01-08 08:31:15 -08:00
os_pri.h
pc_init.h
pc_maint.h
pc.h
pkmaint.h
platform.h
pr_pc.h
s_4bri.c
s_bri.c
s_pri.c
sdp_hdr.h
um_idi.c
um_idi.h
um_xdi.h
xdi_adapter.h
xdi_msg.h
xdi_vers.h