diff options
author | Alexander Aring <alex.aring@gmail.com> | 2015-05-17 21:44:59 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-05-19 11:44:45 +0200 |
commit | 3186d3d7aec3b2f242abbc0a0219226e7705c905 (patch) | |
tree | d2901dc705ba9949c1c70fdddf0e1cc1d4ccf3a2 /drivers/net/ieee802154 | |
parent | 7e57905ba6c825f38f146b5f8974c2ce27f299bb (diff) | |
download | blackbird-op-linux-3186d3d7aec3b2f242abbc0a0219226e7705c905.tar.gz blackbird-op-linux-3186d3d7aec3b2f242abbc0a0219226e7705c905.zip |
fakelb: use list_for_each_entry_safe
Iterate and removing items from a list, we should use
list_for_each_entry_safe instead list_for_each_entry to avoid accidents
by removing.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net/ieee802154')
-rw-r--r-- | drivers/net/ieee802154/fakelb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c index cc1c7df25009..66f99c4f9768 100644 --- a/drivers/net/ieee802154/fakelb.c +++ b/drivers/net/ieee802154/fakelb.c @@ -215,7 +215,7 @@ static void fakelb_del(struct fakelb_dev_priv *priv) static int fakelb_probe(struct platform_device *pdev) { struct fakelb_priv *priv; - struct fakelb_dev_priv *dp; + struct fakelb_dev_priv *dp, *tmp; int err = -ENOMEM; int i; @@ -238,7 +238,7 @@ static int fakelb_probe(struct platform_device *pdev) return 0; err_slave: - list_for_each_entry(dp, &priv->list, list) + list_for_each_entry_safe(dp, tmp, &priv->list, list) fakelb_del(dp); err_alloc: return err; |