prevent a panic when the netdev/ifp is not set in attach

(internal  c63a7b85)

MFC after:	3 days
This commit is contained in:
Luigi Rizzo 2014-06-06 10:40:20 +00:00
parent 275b78396e
commit 441ab64f52

View File

@ -2260,7 +2260,8 @@ netmap_attach(struct netmap_adapter *arg)
fail:
D("fail, arg %p ifp %p na %p", arg, ifp, hwna);
netmap_detach(ifp);
if (ifp)
netmap_detach(ifp);
return (hwna ? EINVAL : ENOMEM);
}