提交 3186d3d7 编写于 作者: A Alexander Aring 提交者: Marcel Holtmann

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: NAlexander Aring <alex.aring@gmail.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 7e57905b
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册