linux/drivers/staging/rts5208
Dan Carpenter 7f7aeea7cf staging: rts5208: Fix "seg_no" calculation in reset_ms_card()
I get some static checker warnings like this:

    drivers/staging/rts5208/ms.c:2607 ms_build_l2p_tbl()
    error: buffer underflow 'ms_card->segment' (-1)-16

The problem is that we memset "ms_card" to zero at the start of the
reset_ms_card() function.  That means that when we try to calculate
"ms_card->total_block / 512 - 1" then it's just always -1.  The fix is
to calculate "seg_no" before doing the memset().

This is a static checker fix, and I am not able to test it.  My theory
is that reset_ms_card() gets very little testing which is why this bug
exists.

Fixes: fa590c222f ("staging: rts5208: add support for rts5208 and rts5288")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-22 15:21:09 +01:00
..
general.c
general.h
Kconfig
Makefile
ms.c staging: rts5208: Fix "seg_no" calculation in reset_ms_card() 2018-01-22 15:21:09 +01:00
ms.h staging: rts5208: ms.h: Parenthesis alignment 2016-10-16 10:27:10 +02:00
rtsx_card.c staging: rts5208: Comparison to NULL 2016-10-16 10:27:02 +02:00
rtsx_card.h staging: rts5208: Unecessary parantheses 2016-10-16 10:26:58 +02:00
rtsx_chip.c staging: rts5208: Change fixed function names with "%s: ", __func__ 2017-07-30 08:29:31 -07:00
rtsx_chip.h staging: rts5208: rtxs_chip.h: Long lines 2016-10-16 10:27:18 +02:00
rtsx_scsi.c staging/rts5208: fix incorrect shift to extract upper nybble 2017-08-20 11:08:41 -07:00
rtsx_scsi.h staging: rts5208: Alignment fix 2016-10-16 10:26:46 +02:00
rtsx_sys.h staging: rts5208: Unnecessary parentheses cleanup 2016-10-16 10:26:45 +02:00
rtsx_transport.c staging: rts5208: Remove unnecessary cast on void pointer 2017-03-09 18:50:05 +01:00
rtsx_transport.h staging: rts5208: Alignment fixes 2016-10-16 10:26:44 +02:00
rtsx.c staging: rts5208: remove rtsx_read_pci_cfg_byte() 2017-11-28 14:20:50 +01:00
rtsx.h staging: rts5208: remove rtsx_read_pci_cfg_byte() 2017-11-28 14:20:50 +01:00
sd.c staging: rts5208: fix gcc-8 logic error warning 2017-09-17 16:35:25 +02:00
sd.h staging: rts5208: sd: fix misspelled constant 2018-01-10 19:14:47 +01:00
spi.c staging: rts5208: Change fixed function names with "%s: ", __func__ 2017-07-30 08:29:31 -07:00
spi.h
TODO
trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.h
xd.c staging: rts5208: Change fixed function names with "%s: ", __func__ 2017-07-30 08:29:31 -07:00
xd.h