diff options
Diffstat (limited to 'drivers/block/aoe/aoedev.c')
-rw-r--r-- | drivers/block/aoe/aoedev.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c index ec16c64dd114..6e231c5a1199 100644 --- a/drivers/block/aoe/aoedev.c +++ b/drivers/block/aoe/aoedev.c | |||
@@ -109,25 +109,22 @@ aoedev_set(ulong sysminor, unsigned char *addr, struct net_device *ifp, ulong bu | |||
109 | spin_lock_irqsave(&devlist_lock, flags); | 109 | spin_lock_irqsave(&devlist_lock, flags); |
110 | 110 | ||
111 | for (d=devlist; d; d=d->next) | 111 | for (d=devlist; d; d=d->next) |
112 | if (d->sysminor == sysminor | 112 | if (d->sysminor == sysminor) |
113 | || memcmp(d->addr, addr, sizeof d->addr) == 0) | ||
114 | break; | 113 | break; |
115 | 114 | ||
116 | if (d == NULL && (d = aoedev_newdev(bufcnt)) == NULL) { | 115 | if (d == NULL && (d = aoedev_newdev(bufcnt)) == NULL) { |
117 | spin_unlock_irqrestore(&devlist_lock, flags); | 116 | spin_unlock_irqrestore(&devlist_lock, flags); |
118 | printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n"); | 117 | printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n"); |
119 | return NULL; | 118 | return NULL; |
120 | } | 119 | } /* if newdev, (d->flags & DEVFL_UP) == 0 for below */ |
121 | 120 | ||
122 | spin_unlock_irqrestore(&devlist_lock, flags); | 121 | spin_unlock_irqrestore(&devlist_lock, flags); |
123 | spin_lock_irqsave(&d->lock, flags); | 122 | spin_lock_irqsave(&d->lock, flags); |
124 | 123 | ||
125 | d->ifp = ifp; | 124 | d->ifp = ifp; |
126 | 125 | memcpy(d->addr, addr, sizeof d->addr); | |
127 | if (d->sysminor != sysminor | 126 | if ((d->flags & DEVFL_UP) == 0) { |
128 | || (d->flags & DEVFL_UP) == 0) { | ||
129 | aoedev_downdev(d); /* flushes outstanding frames */ | 127 | aoedev_downdev(d); /* flushes outstanding frames */ |
130 | memcpy(d->addr, addr, sizeof d->addr); | ||
131 | d->sysminor = sysminor; | 128 | d->sysminor = sysminor; |
132 | d->aoemajor = AOEMAJOR(sysminor); | 129 | d->aoemajor = AOEMAJOR(sysminor); |
133 | d->aoeminor = AOEMINOR(sysminor); | 130 | d->aoeminor = AOEMINOR(sysminor); |