Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
link: link_msg_parser(): keep link info instead of release and reacquire
Calling release_link_info() will call io_free() for rtnl_link::l_info was allocated just a few lines before as a side effect of rtnl_link_set_type(). Apart from doing needless memory churn, this will also leave the link with l_info set to NULL if the link type does not provide a io_parse() function. Assuming the memory leak mentioned in bfee88b ("route: fix memory leak of l_info_ops in link_msg_parser()") was a double reference taken by calling rtnl_link_info_ops_lookup() twice, once via rtnl_link_set_type(), and once directly, replace the lookup() / release() lookup() with a single lookup() and then reuse the populated rtnl_link::l_info_ops pointer. Fixes: bfee88b ("route: fix memory leak of l_info_ops in link_msg_parser()") Signed-off-by: Jonas Gorski <[email protected]>
- Loading branch information