netdev: Return -EINPROGRESS if already disconnecting

This commit is contained in:
Denis Kenzior 2016-09-22 11:48:32 -05:00
parent 47fa0435ba
commit 1585ccc897
1 changed files with 3 additions and 0 deletions

View File

@ -1202,6 +1202,9 @@ int netdev_disconnect(struct netdev *netdev,
if (!netdev->connected)
return -ENOTCONN;
if (netdev->disconnect_cmd_id)
return -EINPROGRESS;
netdev->result = NETDEV_RESULT_ABORTED;
netdev_connect_failed(NULL, netdev);