o net/socket: return -EAFNOSUPPORT if net_family_get fails at sock_create and sys_accept

Thanks to Rusty for spotting this one, if the net family module is not there
anymore (or is going away at that time) it is not supported, not busy.
parent ef3b1140
...@@ -1091,7 +1091,7 @@ int sock_create(int family, int type, int protocol, struct socket **res) ...@@ -1091,7 +1091,7 @@ int sock_create(int family, int type, int protocol, struct socket **res)
sock->type = type; sock->type = type;
i = -EBUSY; i = -EAFNOSUPPORT;
if (!net_family_get(family)) if (!net_family_get(family))
goto out_release; goto out_release;
...@@ -1288,7 +1288,7 @@ asmlinkage long sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_a ...@@ -1288,7 +1288,7 @@ asmlinkage long sys_accept(int fd, struct sockaddr *upeer_sockaddr, int *upeer_a
if (err) if (err)
goto out_release; goto out_release;
err = -EBUSY; err = -EAFNOSUPPORT;
if (!net_family_get(sock->ops->family)) if (!net_family_get(sock->ops->family))
goto out_release; goto out_release;
......
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