Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp262480pxx; Wed, 28 Oct 2020 04:25:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzigca9X+ESF74TyfliZ0UgY5REEvJKMRxI7PsCN9iaMDElYxV7a+ljG2NIwcFWHGHcRvwN X-Received: by 2002:a17:906:cc53:: with SMTP id mm19mr6896949ejb.514.1603884330515; Wed, 28 Oct 2020 04:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603884330; cv=none; d=google.com; s=arc-20160816; b=0lXIyXdvf2tytqe+RrBkgrl0aMum/X8x85OfLNPNENmxyxAPje3ooUohiFxyjRB3Sl jqUvr5IgJ4IukSBc6boS/QHQMfxA2O2tHzPYtUV9kL0tBp+lya7f5v8XOia+7lXbHIvS ra+SFjcO8dFoac0JiqDfOrLuEV43oTTNsIncnfkcaDNnaV/aw5FhJJQPkIwSHwPVdkF4 oqE/F4KX3ZUnYJXiFFapDHLdRBluspo33vvk/K689AzbwyuvviPDxVwFbxJFh/YO3mLo 9fprJA87f38CAR9Hq0ITioFp6xSdq9YzbuUNsJs3+GFzuFa2uVwDvZ4Xi2kn7msZT8VO ov9w== 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=TNeN7ECNqGEvlNtekc22+ZIbimEBjOERIBlrq5+XYI4=; b=n9GIZ+shggsJQlISbdzhwiolnbKCRVF74w4FDuUwrqCKTSkhZczr8eH5AKN1mWWAFB 9FjTvywf3ueLQWqAvTFvO+NqeywMu+eJUDiU6yrXYcQLt9rzGyaIVk+M3KPgqUQkfvtu pBH92MIJr6obD0lHoLKSU94pBe8jwy7UHU0xrCFn2iOM61JqUTAEZ9bOtMHN/l5GpEen 9wtdY4d0ih/Q4pa293O7k/T7oONadzodl7LbbhfsipoyvAsf2mK/yBj0cMgPsOX71LHh PsedUit7/E1oZLm4Qvzcr/yPxapeVsDMsRdGqvXNkja1ISpCkrUJIhq6psnOXdV95Ey8 OyZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KAqeyN5i; 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 z8si2802677eju.267.2020.10.28.04.25.08; Wed, 28 Oct 2020 04:25:30 -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=KAqeyN5i; 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 S1790073AbgJ0PDp (ORCPT + 99 others); Tue, 27 Oct 2020 11:03:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:34578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762711AbgJ0PAz (ORCPT ); Tue, 27 Oct 2020 11:00:55 -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 1F0A820715; Tue, 27 Oct 2020 15:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810854; bh=GCUZ+obrRO/mkdif81IOj6kbqeFpTp5nuaf/sZgNLYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KAqeyN5iAQDUV4A/WUKIaqx0xpOt4XSuXkkS4iziyftIP+MQeSLmonFTnNx0TyA+6 WvFrRPHctYWgUv8CpkafXb72peZdvltBHIy/atq+JzlZa6E6gRMmB00hvyvwxG3VH0 q+TEa63qoay5L2PDGmoThl275CDEGtvJ14nQlDHY= 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.8 287/633] qtnfmac: fix resource leaks on unsupported iftype error return path Date: Tue, 27 Oct 2020 14:50:30 +0100 Message-Id: <20201027135536.137667732@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 f40d8c3c3d9e5..f3ccbd2b10847 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -869,6 +869,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; } @@ -1924,6 +1925,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