Unverified Commit e8319bdd authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7400 net/tg3: fix race condition in tg3_reset_task()

parents 2f4cf035 8ed728b3
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -6454,6 +6454,14 @@ static void tg3_dump_state(struct tg3 *tp)
	int i;
	u32 *regs;

	/* If it is a PCI error, all registers will be 0xffff,
	 * we don't dump them out, just report the error and return
	 */
	if (tp->pdev->error_state != pci_channel_io_normal) {
		netdev_err(tp->dev, "PCI channel ERROR!\n");
		return;
	}

	regs = kzalloc(TG3_REG_BLK_SIZE, GFP_ATOMIC);
	if (!regs)
		return;
@@ -11195,7 +11203,8 @@ static void tg3_reset_task(struct work_struct *work)
	rtnl_lock();
	tg3_full_lock(tp, 0);

	if (tp->pcierr_recovery || !netif_running(tp->dev)) {
	if (tp->pcierr_recovery || !netif_running(tp->dev) ||
	    tp->pdev->error_state != pci_channel_io_normal) {
		tg3_flag_clear(tp, RESET_TASK_PENDING);
		tg3_full_unlock(tp);
		rtnl_unlock();