o af_pppox: return -EPROTONOSUPPORT if try_module_get fails at pppox_create

Thanks to Rusty for spotting this one, if the protocol module is not there
anymore (or is going away at that time) it is not supported, not busy.
parent 9614c538
......@@ -149,11 +149,8 @@ static int pppox_create(struct socket *sock, int protocol)
goto out;
rc = -EPROTONOSUPPORT;
if (!pppox_protos[protocol])
goto out;
rc = -EBUSY;
if (!try_module_get(pppox_protos[protocol]->owner))
if (!pppox_protos[protocol] ||
!try_module_get(pppox_protos[protocol]->owner))
goto out;
rc = pppox_protos[protocol]->create(sock);
......
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