[LLC]: fix net_device refcounting bug

parent 3f5b025e
......@@ -187,6 +187,8 @@ static int llc_ui_release(struct socket *sock)
llc_release_sockets(llc->sap);
llc_sap_close(llc->sap);
}
if (llc->dev)
dev_put(llc->dev);
sock_put(sk);
llc_sk_free(sk);
out:
......@@ -257,6 +259,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr)
rc = -ENETUNREACH;
if (!dev)
goto out;
dev_hold(dev);
llc->dev = dev;
}
/* bind to a specific sap, optional. */
......
Markdown is supported
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