diff options
Diffstat (limited to 'drivers/block/aoe/aoecmd.c')
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index cc692fee7ce1..2f19b9bba913 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -494,12 +494,15 @@ static void | |||
494 | ejectif(struct aoetgt *t, struct aoeif *ifp) | 494 | ejectif(struct aoetgt *t, struct aoeif *ifp) |
495 | { | 495 | { |
496 | struct aoeif *e; | 496 | struct aoeif *e; |
497 | struct net_device *nd; | ||
497 | ulong n; | 498 | ulong n; |
498 | 499 | ||
500 | nd = ifp->nd; | ||
499 | e = t->ifs + NAOEIFS - 1; | 501 | e = t->ifs + NAOEIFS - 1; |
500 | n = (e - ifp) * sizeof *ifp; | 502 | n = (e - ifp) * sizeof *ifp; |
501 | memmove(ifp, ifp+1, n); | 503 | memmove(ifp, ifp+1, n); |
502 | e->nd = NULL; | 504 | e->nd = NULL; |
505 | dev_put(nd); | ||
503 | } | 506 | } |
504 | 507 | ||
505 | static int | 508 | static int |
@@ -1317,6 +1320,7 @@ setifbcnt(struct aoetgt *t, struct net_device *nd, int bcnt) | |||
1317 | pr_err("aoe: device setifbcnt failure; too many interfaces.\n"); | 1320 | pr_err("aoe: device setifbcnt failure; too many interfaces.\n"); |
1318 | return; | 1321 | return; |
1319 | } | 1322 | } |
1323 | dev_hold(nd); | ||
1320 | p->nd = nd; | 1324 | p->nd = nd; |
1321 | p->bcnt = bcnt; | 1325 | p->bcnt = bcnt; |
1322 | } | 1326 | } |