Commit 5775f00e1206fd425609c26ee9a3620149e567ac
Committed by
Joe Hershberger
1 parent
d38de3380d
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
net: tsec: Fix memory leak in error path
tsec_initialize allocates a private driver structure using malloc. Should the memory allocation of this private structure fail, the function execution is aborted with a return 0, but the previously allocated device structure is never freed, hence leaked. Free the device structure in the error case. Signed-off-by: Mario Six <mario.six@gdsys.cc> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff
drivers/net/tsec.c