Skip to content

Commit 88a2428

Browse files
Wei Yongjundavem330
authored andcommitted
qed: Fix to use list_for_each_entry_safe() when delete items
Since we will remove items off the list using list_del() we need to use a safe version of the list_for_each_entry() macro aptly named list_for_each_entry_safe(). Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Yuval Mintz <Yuval.Mintz@caviumnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1e09c10 commit 88a2428

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/net/ethernet/qlogic/qed/qed_ll2.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ static void qed_ll2_register_cb_ops(struct qed_dev *cdev,
15171517
static int qed_ll2_start(struct qed_dev *cdev, struct qed_ll2_params *params)
15181518
{
15191519
struct qed_ll2_info ll2_info;
1520-
struct qed_ll2_buffer *buffer;
1520+
struct qed_ll2_buffer *buffer, *tmp_buffer;
15211521
enum qed_ll2_conn_type conn_type;
15221522
struct qed_ptt *p_ptt;
15231523
int rc, i;
@@ -1587,7 +1587,7 @@ static int qed_ll2_start(struct qed_dev *cdev, struct qed_ll2_params *params)
15871587

15881588
/* Post all Rx buffers to FW */
15891589
spin_lock_bh(&cdev->ll2->lock);
1590-
list_for_each_entry(buffer, &cdev->ll2->list, list) {
1590+
list_for_each_entry_safe(buffer, tmp_buffer, &cdev->ll2->list, list) {
15911591
rc = qed_ll2_post_rx_buffer(QED_LEADING_HWFN(cdev),
15921592
cdev->ll2->handle,
15931593
buffer->phys_addr, 0, buffer, 1);

0 commit comments

Comments
 (0)