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: NMario Six <mario.six@gdsys.cc> Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
Showing
想要评论请 注册 或 登录