diff options
| author | Tom Rix <[email protected]> | 2020-06-17 12:40:28 +0000 |
|---|---|---|
| committer | Paul Moore <[email protected]> | 2020-06-17 21:36:40 +0000 |
| commit | 8231b0b9c322c894594fb42eb0eb9f93544a6acc (patch) | |
| tree | 69b85357797d0afd34707c655783a036cae386ec /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
| parent | selinux: fix a double free in cond_read_node()/cond_read_list() (diff) | |
| download | kernel-8231b0b9c322c894594fb42eb0eb9f93544a6acc.tar.gz kernel-8231b0b9c322c894594fb42eb0eb9f93544a6acc.zip | |
selinux: fix undefined return of cond_evaluate_expr
clang static analysis reports an undefined return
security/selinux/ss/conditional.c:79:2: warning: Undefined or garbage value returned to caller [core.uninitialized.UndefReturn]
return s[0];
^~~~~~~~~~~
static int cond_evaluate_expr( ...
{
u32 i;
int s[COND_EXPR_MAXDEPTH];
for (i = 0; i < expr->len; i++)
...
return s[0];
When expr->len is 0, the loop which sets s[0] never runs.
So return -1 if the loop never runs.
Cc: [email protected]
Signed-off-by: Tom Rix <[email protected]>
Acked-by: Stephen Smalley <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
0 files changed, 0 insertions, 0 deletions
