aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe/aoedev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/aoe/aoedev.c')
-rw-r--r--drivers/block/aoe/aoedev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index 240abaec159b..ec16c64dd114 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -13,7 +13,7 @@ static struct aoedev *devlist;
13static spinlock_t devlist_lock; 13static spinlock_t devlist_lock;
14 14
15struct aoedev * 15struct aoedev *
16aoedev_bymac(unsigned char *macaddr) 16aoedev_by_aoeaddr(int maj, int min)
17{ 17{
18 struct aoedev *d; 18 struct aoedev *d;
19 ulong flags; 19 ulong flags;
@@ -21,7 +21,7 @@ aoedev_bymac(unsigned char *macaddr)
21 spin_lock_irqsave(&devlist_lock, flags); 21 spin_lock_irqsave(&devlist_lock, flags);
22 22
23 for (d=devlist; d; d=d->next) 23 for (d=devlist; d; d=d->next)
24 if (!memcmp(d->addr, macaddr, 6)) 24 if (d->aoemajor == maj && d->aoeminor == min)
25 break; 25 break;
26 26
27 spin_unlock_irqrestore(&devlist_lock, flags); 27 spin_unlock_irqrestore(&devlist_lock, flags);
@@ -125,7 +125,6 @@ aoedev_set(ulong sysminor, unsigned char *addr, struct net_device *ifp, ulong bu
125 d->ifp = ifp; 125 d->ifp = ifp;
126 126
127 if (d->sysminor != sysminor 127 if (d->sysminor != sysminor
128 || memcmp(d->addr, addr, sizeof d->addr)
129 || (d->flags & DEVFL_UP) == 0) { 128 || (d->flags & DEVFL_UP) == 0) {
130 aoedev_downdev(d); /* flushes outstanding frames */ 129 aoedev_downdev(d); /* flushes outstanding frames */
131 memcpy(d->addr, addr, sizeof d->addr); 130 memcpy(d->addr, addr, sizeof d->addr);
@@ -147,7 +146,8 @@ aoedev_freedev(struct aoedev *d)
147 put_disk(d->gd); 146 put_disk(d->gd);
148 } 147 }
149 kfree(d->frames); 148 kfree(d->frames);
150 mempool_destroy(d->bufpool); 149 if (d->bufpool)
150 mempool_destroy(d->bufpool);
151 kfree(d); 151 kfree(d);
152} 152}
153 153