Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp110497ybg; Mon, 8 Jun 2020 17:54:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU4HdSk1Py+kExztV25wTi8qpqoO9pbiXQX+XiToWSStakiQbas8nHlcAS3rG+KpdIfcwu X-Received: by 2002:a17:906:5203:: with SMTP id g3mr22537061ejm.58.1591664043438; Mon, 08 Jun 2020 17:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664043; cv=none; d=google.com; s=arc-20160816; b=eYGII39OBIZfzWTkV+WJBdd5X9aIrAPoaz9aKkD7XBfnB2xOtPeOwObOvQj/kw0S/V Q32dlUSsJ2V1ciqAGoHarUxRGv5ixlOHk4nGe89VbqTH9X6GSvnkXVyrXL6mW3sUA0aq QuPTukLoGdGGqByWzvxbMXhuee01z+CB9u1zu7eRzayuWUtTFW1nfckrXpA4cDFblxz+ log8p7cMWDIwTWDwEIJKP2u+sEfWjwSYzVC/0RxDBoYYeM06QcAUVoaaOSy0KsW15DUq 0swOLdon58DhwEXYlAeG0KRdtsJVNKT+n1RZ+56nfC+OGMox+HWYe2JJzD8zV3BwBefz Wu7g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=96AuanIA2rT1/lEkHyyN/L+meqQr1JkLLxQhEqei1V4=; b=ElQE98K8tUBj+4VpNgO9WBA+HvoUgMkIRge1d+TjFHCvf1BBqwovH0PMJUcEmHMY1V FwqEDVYZYagLXeX35Kj33/d0WvSmVhhjBG7cotVE0szc4Sdg5Sm+tuxWWdwNzMs656JQ BdY9SiaC83s4jXO1KIAq7jnsVH7pR9AEpusvznNOK8GHqdH52RIsaA88qJUCbP6RLNfY U8J/bGK/0cKIcX33rL7YaMEITKR1NFNAOPjQ8zVGz+75opR8sT30seETIYTMe4PZ4yjl 1ZenAiNyAvwN0DI3X6EacTxC5Y3GhlJ1KD56+fLUUY6kOIToxsroR3vISZudm+jlRwCl xvGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="m32/6Wi/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u14si9296536ejf.226.2020.06.08.17.53.40; Mon, 08 Jun 2020 17:54:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="m32/6Wi/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730725AbgFIAwB (ORCPT + 99 others); Mon, 8 Jun 2020 20:52:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:56228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726907AbgFHXKL (ORCPT ); Mon, 8 Jun 2020 19:10:11 -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 D606F212CC; Mon, 8 Jun 2020 23:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657810; bh=x/hwxkdbdu7u6AazMGFK0CvTxvW1mE8KvYKMVZZL0Dk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m32/6Wi/6okH5IZyKqQGHump6D6bBohhmYDxRFoQGzIkkwGWPupHta7f6dqzPvRUy rBlE/YMk0KH6gwz0c1UrjUpWRsAkFbZ7/qU2HyrL0LvLFdIV9TGjs2SrSGF+KOyWDI 7aBIehQRLSNTTeV+Z0n2usHRbc7YQukK+aEidUsU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe JAILLET , Bjorn Andersson , Kalle Valo , Sasha Levin , wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 186/274] wcn36xx: Fix error handling path in 'wcn36xx_probe()' Date: Mon, 8 Jun 2020 19:04:39 -0400 Message-Id: <20200608230607.3361041-186-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit a86308fc534edeceaf64670c691e17485436a4f4 ] In case of error, 'qcom_wcnss_open_channel()' must be undone by a call to 'rpmsg_destroy_ept()', as already done in the remove function. Fixes: 5052de8deff5 ("soc: qcom: smd: Transition client drivers from smd to rpmsg") Signed-off-by: Christophe JAILLET Reviewed-by: Bjorn Andersson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200507043619.200051-1-christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/wcn36xx/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c index e49c306e0eef..702b689c06df 100644 --- a/drivers/net/wireless/ath/wcn36xx/main.c +++ b/drivers/net/wireless/ath/wcn36xx/main.c @@ -1339,7 +1339,7 @@ static int wcn36xx_probe(struct platform_device *pdev) if (addr && ret != ETH_ALEN) { wcn36xx_err("invalid local-mac-address\n"); ret = -EINVAL; - goto out_wq; + goto out_destroy_ept; } else if (addr) { wcn36xx_info("mac address: %pM\n", addr); SET_IEEE80211_PERM_ADDR(wcn->hw, addr); @@ -1347,7 +1347,7 @@ static int wcn36xx_probe(struct platform_device *pdev) ret = wcn36xx_platform_get_resources(wcn, pdev); if (ret) - goto out_wq; + goto out_destroy_ept; wcn36xx_init_ieee80211(wcn); ret = ieee80211_register_hw(wcn->hw); @@ -1359,6 +1359,8 @@ static int wcn36xx_probe(struct platform_device *pdev) out_unmap: iounmap(wcn->ccu_base); iounmap(wcn->dxe_base); +out_destroy_ept: + rpmsg_destroy_ept(wcn->smd_channel); out_wq: ieee80211_free_hw(hw); out_err: -- 2.25.1