rtnl_link_af_unregister: fix locking
rtnl_link_af_unregister() attempts to write-lock info_lock twice instead of releasing it before returning. It also will return with info_lock write-locked if passed a NULL ops. Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
parent
183052d047
commit
8983fa9914
1 changed files with 2 additions and 2 deletions
|
@ -326,7 +326,7 @@ int rtnl_link_af_unregister(struct rtnl_link_af_ops *ops)
|
|||
int err = -NLE_INVAL;
|
||||
|
||||
if (!ops)
|
||||
goto errout;
|
||||
return err;
|
||||
|
||||
nl_write_lock(&info_lock);
|
||||
if (!af_ops[ops->ao_family]) {
|
||||
|
@ -345,7 +345,7 @@ int rtnl_link_af_unregister(struct rtnl_link_af_ops *ops)
|
|||
ops->ao_family);
|
||||
|
||||
errout:
|
||||
nl_write_lock(&info_lock);
|
||||
nl_write_unlock(&info_lock);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue