aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_dp_mst.c
diff options
context:
space:
mode:
authorTom Rix <[email protected]>2020-06-15 13:45:48 -0700
committerPaul Moore <[email protected]>2020-06-16 20:25:19 -0400
commitaa449a7965a6172a89d48844c313708962216f1f (patch)
treec76ab322333c9ec3f3087e75dd95cbaa5decafe9 /drivers/gpu/drm/i915/display/intel_dp_mst.c
parent65de50969a77509452ae590e9449b70a22b923bb (diff)
selinux: fix a double free in cond_read_node()/cond_read_list()
Clang static analysis reports this double free error security/selinux/ss/conditional.c:139:2: warning: Attempt to free released memory [unix.Malloc] kfree(node->expr.nodes); ^~~~~~~~~~~~~~~~~~~~~~~ When cond_read_node fails, it calls cond_node_destroy which frees the node but does not poison the entry in the node list. So when it returns to its caller cond_read_list, cond_read_list deletes the partial list. The latest entry in the list will be deleted twice. So instead of freeing the node in cond_read_node, let list freeing in code_read_list handle the freeing the problem node along with all of the earlier nodes. Because cond_read_node no longer does any error handling, the goto's the error case are redundant. Instead just return the error code. Cc: [email protected] Fixes: 60abd3181db2 ("selinux: convert cond_list to array") Signed-off-by: Tom Rix <[email protected]> Reviewed-by: Ondrej Mosnacek <[email protected]> [PM: subject line tweaks] Signed-off-by: Paul Moore <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_dp_mst.c')
0 files changed, 0 insertions, 0 deletions