Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 149ac7cf authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: qrtr: mhi: check whether ul pkt list is empty"

parents ed71629c d0c4272c
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. */


#include <linux/module.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/skbuff.h>
@@ -63,6 +63,11 @@ static void qcom_mhi_qrtr_ul_callback(struct mhi_device *mhi_dev,
	unsigned long flags;
	unsigned long flags;


	spin_lock_irqsave(&qdev->ul_lock, flags);
	spin_lock_irqsave(&qdev->ul_lock, flags);
	if (list_empty(&qdev->ul_pkts)) {
		spin_unlock_irqrestore(&qdev->ul_lock, flags);
		dev_err(qdev->dev, "ul_pkt list is empty\n");
		return;
	}
	pkt = list_first_entry(&qdev->ul_pkts, struct qrtr_mhi_pkt, node);
	pkt = list_first_entry(&qdev->ul_pkts, struct qrtr_mhi_pkt, node);
	list_del(&pkt->node);
	list_del(&pkt->node);
	complete_all(&pkt->done);
	complete_all(&pkt->done);