Skip to content
Commit 7e5b6a5c authored by Tom Rix's avatar Tom Rix Committed by David S. Miller
Browse files

mctp: fix use after free

Clang static analysis reports this problem
route.c:425:4: warning: Use of memory after it is freed
  trace_mctp_key_acquire(key);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
When mctp_key_add() fails, key is freed but then is later
used in trace_mctp_key_acquire().  Add an else statement
to use the key only when mctp_key_add() is successful.

Fixes: 4f9e1ba6

 ("mctp: Add tracepoints for tag/key handling")
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ef576405
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment