summaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe/aoedev.c
diff options
context:
space:
mode:
authorEd Cashin <ecashin@coraid.com>2012-10-04 17:16:34 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-06 03:05:27 +0900
commit1b86fda9adf1b691a76f8ceddfc59d0c8386257c (patch)
treeda4fcaa9696231ff7bd84b0614706aefca7d7d6c /drivers/block/aoe/aoedev.c
parent64a80f5ac78a289f66c373ace61973205d960ee7 (diff)
downloadop-kernel-dev-1b86fda9adf1b691a76f8ceddfc59d0c8386257c.zip
op-kernel-dev-1b86fda9adf1b691a76f8ceddfc59d0c8386257c.tar.gz
aoe: increase net_device reference count while using it
This change eliminates the danger that the user could rmmod the driver for a network interface that is being used for AoE by the aoe driver. Signed-off-by: Ed Cashin <ecashin@coraid.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/aoe/aoedev.c')
-rw-r--r--drivers/block/aoe/aoedev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index 3968fe6..6be7b38 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -295,6 +295,13 @@ freetgt(struct aoedev *d, struct aoetgt *t)
{
struct frame *f;
struct list_head *pos, *nx, *head;
+ struct aoeif *ifp;
+
+ for (ifp = t->ifs; ifp < &t->ifs[NAOEIFS]; ++ifp) {
+ if (!ifp->nd)
+ break;
+ dev_put(ifp->nd);
+ }
head = &t->ffree;
list_for_each_safe(pos, nx, head) {
OpenPOWER on IntegriCloud