Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3485646imu; Sun, 11 Nov 2018 16:10:31 -0800 (PST) X-Google-Smtp-Source: AJdET5cZJsW9IRHF8LIQ/apWRcBAtjPDFWd2ukygLK+pkObp1Kx7H5K/QoqDu+S7lUvPiIfg74Rq X-Received: by 2002:a62:8749:: with SMTP id i70-v6mr18378146pfe.41.1541981431725; Sun, 11 Nov 2018 16:10:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981431; cv=none; d=google.com; s=arc-20160816; b=rdtO81kJE+kRmsUfxNoH9HM2mrEHFYah2aG7gIYGa2R5gaYhvbJdMaMM+bnDIKWliW drV72RBShbrHDNUUbPsYqBj5HQKtPTfqxF1MvDg6WDMY5C80i2xgdCF4q0wdGtgqoxCa OMObGe1/xyk+Gu2IwQp5vJAtFhi20XqRyOkl1yI7uu+awftBytt1UiaOzjQkNMPOH2EH 6tRn2QXf9N8a+b2cPJz3ZfR4W/9fsUh6lAz/lLZv87lGD6MbmqL2ClE/uXxwjYeFd9Jy mJ4gnT6CQu2VQbqVLaWDVBdiOojc/Uvv390I3sEyyct+LmhbOigaLuyfnGIF/sXh1yTV wzTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4gLBWpkNkOYF0gGdAMneNlzeaMNHMniV5PS+R4/kxks=; b=ZxYqcqxCwoDYqTeca5iRMcwcCU7n8H4Q6c1xdUrhfRhhnHIvC4MeWyAScosS9H9TaT Yj5uOVOfpOGBgpJfwXaJCaj6FwQ0Q+2hBkkXeyFe6VYoFYYDB6fGYeuRiQAPcocL+NBv Y4tuuw1VtkxT2Wizs2fatDUJ+dI+zlp665NRMpxOYzWj1yLVgrHSsX6gdG0VJmJHwX5F oSUQQTwb4HHx99RpjWHvorjmidX3UtSq/7KEqmEFuxvfamNkSJT/+PrgZxJB6ShtMsuJ lAYEmecuFKMtG9JU8yl6w7Gt5etgpk+Z/3lxXCnoCNaHYFxoLLIQVumRgKg1cqUGkodW 9zqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="yr/4xFGs"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11-v6si15828115plt.5.2018.11.11.16.10.16; Sun, 11 Nov 2018 16:10:31 -0800 (PST) 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="yr/4xFGs"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731433AbeKLKAW (ORCPT + 99 others); Mon, 12 Nov 2018 05:00:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:60706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730961AbeKLIR1 (ORCPT ); Mon, 12 Nov 2018 03:17:27 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB91721582; Sun, 11 Nov 2018 22:27:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975251; bh=HEgQJ+m8ZU14KUYuQ/psMVG1Num6eTHp7nf3G9ciF1k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yr/4xFGsLQZf1gYkyejGkXuBQZPt0js/DKhrFagUNBnbLz2qFKjfu8KoYgUAj+1Qw vEBY/hVmV/pOprcHJ+Y/VgWkOtRS3denPlrGn6T7PfO4vv/xGjwieDLYUlcW3EyT+v CKG+XNOHJqpVGZqDPmt+MWmjtIXpKWkNGKdFEObc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Bianconi , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 118/361] mt76x2u: run device cleanup routine if resume fails Date: Sun, 11 Nov 2018 14:17:45 -0800 Message-Id: <20181111221636.512561607@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/mediatek/mt76/mt76x2_usb.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) --- 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 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);