diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-01-22 13:23:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-22 17:21:09 +0300 |
commit | 7f7aeea7cf30368b9fdb86dcc9d2c8a3ebc65dfb (patch) | |
tree | f7266fa6b4cb78297d7aaf20ada15da2cd4ab8b4 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | adb77ab0a121a801e50f32d6f7d5d2c7b5aee4fa (diff) | |
download | linux-7f7aeea7cf30368b9fdb86dcc9d2c8a3ebc65dfb.tar.xz |
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: fa590c222fba ("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>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions