Skip to content

Commit

Permalink
ipv4: remove useless codes in ipmr_device_event()
Browse files Browse the repository at this point in the history
Commit 7dc00c8 added a 'notify' parameter for vif_delete() to
distinguish whether to unregister the device.

When notify=1 means we does not need to unregister the device,
so calling unregister_netdevice_many is useless.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
RongQing.Li authored and David S. Miller committed Nov 29, 2011
1 parent 115d2a3 commit e92036a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/ipv4/ipmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,6 @@ static int ipmr_device_event(struct notifier_block *this, unsigned long event, v
struct mr_table *mrt;
struct vif_device *v;
int ct;
LIST_HEAD(list);

if (event != NETDEV_UNREGISTER)
return NOTIFY_DONE;
Expand All @@ -1529,10 +1528,9 @@ static int ipmr_device_event(struct notifier_block *this, unsigned long event, v
v = &mrt->vif_table[0];
for (ct = 0; ct < mrt->maxvif; ct++, v++) {
if (v->dev == dev)
vif_delete(mrt, ct, 1, &list);
vif_delete(mrt, ct, 1, NULL);
}
}
unregister_netdevice_many(&list);
return NOTIFY_DONE;
}

Expand Down

0 comments on commit e92036a

Please sign in to comment.