aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorWang Xiayang <[email protected]>2019-07-27 17:30:30 +0800
committerAlex Deucher <[email protected]>2019-07-30 23:48:33 -0500
commit1a2c29bce06083e0f53f3a328f0bb43a2856b622 (patch)
tree074328d4295b5bb2450a23615c13f31887d3609d /tools/perf/scripts/python
parent649412069501c1710f42ad50ab420e2fd5eaea70 (diff)
drm/amdgpu: fix a potential information leaking bug
Coccinelle reports a path that the array "data" is never initialized. The path skips the checks in the conditional branches when either of callback functions, read_wave_vgprs and read_wave_sgprs, is not registered. Later, the uninitialized "data" array is read in the while-loop below and passed to put_user(). Fix the path by allocating the array with kcalloc(). The patch is simplier than adding a fall-back branch that explicitly calls memset(data, 0, ...). Also it does not need the multiplication 1024*sizeof(*data) as the size parameter for memset() though there is no risk of integer overflow. Signed-off-by: Wang Xiayang <[email protected]> Reviewed-by: Chunming Zhou <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions