Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp221430pxx; Wed, 28 Oct 2020 03:14:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBzZgdN+qfAtodSawdnch1r1QCPBl9vMO2KeLe69KYV38OptSyl1R9c043/G3Q4XR7cNQe X-Received: by 2002:a17:906:118f:: with SMTP id n15mr7147661eja.394.1603880092479; Wed, 28 Oct 2020 03:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603880092; cv=none; d=google.com; s=arc-20160816; b=fBxo6iyYNfEx7wXrClXJb3u+waI70sDJoT2kp/M1qZHrtp3nZATHR30jYDOARSdiu7 jMcNoZlh4czFjFnym83J7BREDk/NZll4Dbq1kVxQKkgV13stgBseWSyNJ+2vh3UofXep ZopcVm6BAprXa7QxjbATE8AkRm/iX6hagV4ITYmVx5MUKFpN1QJVgdChj5E1b9eq89P6 SNjR7E3yyeVzAE2GQZeQ3m70GE+qeJ9vYJXbSD/ud1cUvLOnQUj+R1Y/Ed48gjIykhHt D7zjykZAi/U8X+ojvnk/mD6TRMHvqLNOe54hSMGuy7nUaeWT3M0PPmC3Yuu5mGUVEDO7 NmEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RXGz9wd7l3bG+FMkX33pE5jN94SQKRlaZQXu6J1tpkk=; b=fRqKNHmBDpACtpJRSx7QszDtukNL5k6bFxyVDpdmfEuasTyB6JxeaM+Kypxd6UQtQU 6AfnCozpxc27CRIAjlHWX6bYAHgCDMSUe34ZA7kBLFYtkzijro7JVrjm9LH2/9IZyON7 ZjQn2ieiJtO/Y8yTotiaELYmt+NOzVerT9XW6ioNkwD25KKtoPSBHL4dslaDiiO+kaSi mXFbSLgVZ3rw+WtrH8Lvpg70+NxaCx2Xdn0wYg5NvTxt8XwU7pM0CQ+G58QLO2mmsxcN X3aEeY5CSK06GUnE9nM9oLevIuG7DcBpLAIimjXG/fBTWGm0CvMzW3m+DTNpt8YxJHwg QftQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GzD2kDSo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs17si3022913ejb.543.2020.10.28.03.14.30; Wed, 28 Oct 2020 03:14:52 -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=GzD2kDSo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760852AbgJ0Ogq (ORCPT + 99 others); Tue, 27 Oct 2020 10:36:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:35172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760759AbgJ0OgT (ORCPT ); Tue, 27 Oct 2020 10:36:19 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 DD1EA207BB; Tue, 27 Oct 2020 14:36:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809378; bh=URcluGPclFi2tSlwuzCBwAAsWNmTFJQH+K2k8CGpgHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GzD2kDSoPe54m/2CvMILAPD+owqkTjFLNYgh27aKkhvu1+vEU1an4YCXo3hD2wKzM 8NINyME6owUYgtKvNXhFTxrmBDvFhbpPUyO+D9Hd85krOQiglyJYw+ApZfMfPDDv/m uJNDr6XsW5oJRlhdrzUJafESbZDKzSM9rzHyMYhE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Kalle Valo , Sasha Levin Subject: [PATCH 5.4 174/408] qtnfmac: fix resource leaks on unsupported iftype error return path Date: Tue, 27 Oct 2020 14:51:52 +0100 Message-Id: <20201027135503.166967241@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King [ Upstream commit 63f6982075d890d7563e2469643f05a37d193f01 ] Currently if an unsupported iftype is detected the error return path does not free the cmd_skb leading to a resource leak. Fix this by free'ing cmd_skb. Addresses-Coverity: ("Resource leak") Fixes: 805b28c05c8e ("qtnfmac: prepare for AP_VLAN interface type support") Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200925132224.21638-1-colin.king@canonical.com Signed-off-by: Sasha Levin --- drivers/net/wireless/quantenna/qtnfmac/commands.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index c0c32805fb8de..106f1a846f499 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -834,6 +834,7 @@ int qtnf_cmd_send_del_intf(struct qtnf_vif *vif) default: pr_warn("VIF%u.%u: unsupported iftype %d\n", vif->mac->macid, vif->vifid, vif->wdev.iftype); + dev_kfree_skb(cmd_skb); ret = -EINVAL; goto out; } @@ -1996,6 +1997,7 @@ int qtnf_cmd_send_change_sta(struct qtnf_vif *vif, const u8 *mac, break; default: pr_err("unsupported iftype %d\n", vif->wdev.iftype); + dev_kfree_skb(cmd_skb); ret = -EINVAL; goto out; } -- 2.25.1