|
@@ -494,12 +494,15 @@ static void
|
|
|
ejectif(struct aoetgt *t, struct aoeif *ifp)
|
|
|
{
|
|
|
struct aoeif *e;
|
|
|
+ struct net_device *nd;
|
|
|
ulong n;
|
|
|
|
|
|
+ nd = ifp->nd;
|
|
|
e = t->ifs + NAOEIFS - 1;
|
|
|
n = (e - ifp) * sizeof *ifp;
|
|
|
memmove(ifp, ifp+1, n);
|
|
|
e->nd = NULL;
|
|
|
+ dev_put(nd);
|
|
|
}
|
|
|
|
|
|
static int
|
|
@@ -1317,6 +1320,7 @@ setifbcnt(struct aoetgt *t, struct net_device *nd, int bcnt)
|
|
|
pr_err("aoe: device setifbcnt failure; too many interfaces.\n");
|
|
|
return;
|
|
|
}
|
|
|
+ dev_hold(nd);
|
|
|
p->nd = nd;
|
|
|
p->bcnt = bcnt;
|
|
|
}
|