Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp173737imd; Wed, 31 Oct 2018 16:48:27 -0700 (PDT) X-Google-Smtp-Source: AJdET5fx0cFamu2efw7kyLiDVTrvneJ4EL3+7zqODy99vQJN9+8rnjqOykm4c7aHhlUS8Cu/Zgln X-Received: by 2002:a62:3911:: with SMTP id g17-v6mr5637624pfa.170.1541029707479; Wed, 31 Oct 2018 16:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029707; cv=none; d=google.com; s=arc-20160816; b=LZ6R5iAc6k0bihWWUwj0kvabNjLxCIiKWGtzpy+Qi+p3F/mLFvKLygSlnYvQdqQhjb iJMwqyf9NMpMqj5xgUIDiV+K+Wum14aHeFiRA7vm/qyYMyxLtQQOCMv8U8IAJCj3CjBM aHJyMp+E5bPC63EhFy2L0ukljcLfR0n8XfVOLsi/6lOHReSbR/JngeqQhBzocp6in5oi xaXS9HcpExuLVRH98hShxfBLmYP4+D2pFFPyjKq7g19y/FQW1hRY+OQ8ZtE5QqON9Nai u/qxukBvOqNKLQYvS9oWZ/U/+PGfwy8CC09ointPW8SrLZC40TEFP6SZECeC4cXH+8bA 85lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=mr55jonF/ybK0mPZu8xwl0o8PDF09YxZCXXteHcwVWc=; b=z5sVnBJMK6HDPQxY/YgLePNuLBaxMF+Tcf4sqGCY9eMN/GijuuLUl8sGUWeYHSSyJF CKhKLDXoTGTvbBDi6ylIVIlLjqNjfeqf0dhtW3IS/Vz2+x+v3+U3UgkZ5bJNV4G1VbSF JwwxYMfuK7T2Id9SXjitl7yrJBp6UqiVqfBfUsNb+WHOIFVOkVTRloSWmfZkl4qs1s2o uuOOgmuGXbUQKw6tPNQWHDA9Ct8l8fSbRTwwTrPeRlAZx4gR6zfjKlOGnN/j4/NCX8TD P5Yts/sBvdyKWDQV+UD/+5vIqjqKKrCm9z0+3Ozlm5IK1HQJEgqPB3lfOZttvHqalyLK EQCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KR4sYufq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c27-v6si29299694pgc.461.2018.10.31.16.48.13; Wed, 31 Oct 2018 16:48:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KR4sYufq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728544AbeKAIHC (ORCPT + 99 others); Thu, 1 Nov 2018 04:07:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:54378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728488AbeKAIHA (ORCPT ); Thu, 1 Nov 2018 04:07:00 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3ED5D20840; Wed, 31 Oct 2018 23:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027209; bh=yOJIyMrtPXFaP5aSToUv5MgueleK1Q5RK+u6smJ/9tw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KR4sYufqSE+oTFn8EPp0PZiPg+zbKOmfOWPQ2H1RpOYtKF3kFq3BRDXzr3G3uT5ga o1wtxVVga0L3v8qzAD1OC088/8mg/OPAdr2QT10OM/knGpRTC01quQnUZlb/VZ2/HY LAZAKfKMqLJIIImIImtY9zQzjPeAX3kMybMVfQ90= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lorenzo Bianconi , Kalle Valo , Sasha Levin Subject: [PATCH AUTOSEL 4.19 073/146] mt76x2u: run device cleanup routine if resume fails Date: Wed, 31 Oct 2018 19:04:28 -0400 Message-Id: <20181031230541.28822-73-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lorenzo Bianconi [ Upstream commit 9b2fd48d36e25b9be9ddb8be8cc1eb263a1d1843 ] Cleanup {tx,rx} and mcu queues if resume operation fails Fixes: ee676cd5017c ("mt76: add driver code for MT76x2u based devices") Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt76x2_usb.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2_usb.c index 1428cfdee579..9594433234cc 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2_usb.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2_usb.c @@ -107,16 +107,24 @@ static int __maybe_unused mt76x2u_resume(struct usb_interface *intf) mt76u_mcu_complete_urb, &usb->mcu.cmpl); if (err < 0) - return err; + goto err; err = mt76u_submit_rx_buffers(&dev->mt76); if (err < 0) - return err; + goto err; tasklet_enable(&usb->rx_tasklet); tasklet_enable(&usb->tx_tasklet); - return mt76x2u_init_hardware(dev); + err = mt76x2u_init_hardware(dev); + if (err < 0) + goto err; + + return 0; + +err: + mt76x2u_cleanup(dev); + return err; } MODULE_DEVICE_TABLE(usb, mt76x2u_device_table); -- 2.17.1