Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3757207pxt; Tue, 10 Aug 2021 10:36:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJDK3RC957oL6frUjk7dINhVUSxjMBryvsNtLjmvNCSyKkD+V8meKJ2RwrOXg5lZlaS85D X-Received: by 2002:aa7:d0cc:: with SMTP id u12mr6396564edo.238.1628616966503; Tue, 10 Aug 2021 10:36:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628616966; cv=none; d=google.com; s=arc-20160816; b=HcKFBvTl1qwh9dTSW+VF1jYMhSkaYvAQrEUfgJbii1/PmtLZR5bOzAEDWLTyI76eNc YhuwpfW9j3qltgqbj3GxRcTdP34f+Ky6G/XVVDTr/JOqk5GoiMUaA2rDugXEstFkRKo8 pNrmvTM61x4/+7PW+SWiBYyjJg5Q+pACDsWClbLmu0UWjhiElDkuP0ZpoIDRgHb47eCe uYwzvvZw4N9rczHCC8XeBmPF0NUBVwzYAlJZNgumcBwbTXTXSGJ7QBY0hszchoTfhIVX DZBwH5PW11KDMj9l2XqcyFeZIZvLQWDhwCXJNgI5N8YHkAA1GweTypIrXWd5iUFsyAdh 09uw== 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=iR/6tbt9F6whgdaA6oBxnWehIWPYVw/6WTQLKofh6T0=; b=OB9DgcESeL4WuzbSvJ5Ou8jCYjXBxznC+lAVJAuO346VDGiIjDUb7FvI+CEGyjLQzQ 8EIcqZZTFjWGy668u+Yx4VN7wZtjlXZqSgpPMjyjFb33VuuiBgtZ965jTJplVpLcZvua utApTJRfiD+YoVjCruZSoctHXKcJkOMq9ssLPqJyPki363ay2IwWIkhQh0xgr1M4tRGW GhmxZ0plYhIpfOAdCcKj/Cz9T+m8ug3C8WZ2VA2AKynXnEC6UOQEdqlmO4NWS679MtUr kEcmfWaczzMr6eMuNQyhzN0r+Ai33ppYtzjupB7HJMevS4aK2tD6MsSgUvS/0dDQQzMd doQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1tP3YyWk; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp42si23044818ejc.261.2021.08.10.10.35.42; Tue, 10 Aug 2021 10:36:06 -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=@linuxfoundation.org header.s=korg header.b=1tP3YyWk; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232849AbhHJRdz (ORCPT + 99 others); Tue, 10 Aug 2021 13:33:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:33850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232245AbhHJRdL (ORCPT ); Tue, 10 Aug 2021 13:33:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B46E60E09; Tue, 10 Aug 2021 17:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616768; bh=kLwRbf04wdPDTWhUR1wEgK8ZlS0EXM2rYWxeVLJtKIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1tP3YyWks/QKsXoSBC2TLbLDJ1N5CXCbFGRbuTVowzNxZFGXKs7osRV+TQgfj6csD lcYUrjEljA48l9aL/EjTkJvZyLgUloda2Q7P8NY2NLwzYNuZkqA4ho5u1pKiAvLP/o PoNubiguUv0F4O9YRigMaAsq9Pg79iaptHtoEws0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Xiangyang Zhang Subject: [PATCH 4.19 37/54] staging: rtl8723bs: Fix a resource leak in sd_int_dpc Date: Tue, 10 Aug 2021 19:30:31 +0200 Message-Id: <20210810172945.407789168@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172944.179901509@linuxfoundation.org> References: <20210810172944.179901509@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: Xiangyang Zhang commit 990e4ad3ddcb72216caeddd6e62c5f45a21e8121 upstream. The "c2h_evt" variable is not freed when function call "c2h_evt_read_88xx" failed Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Reviewed-by: Hans de Goede Signed-off-by: Xiangyang Zhang Cc: stable Link: https://lore.kernel.org/r/20210628152239.5475-1-xyz.sun.ok@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/sdio_ops.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/staging/rtl8723bs/hal/sdio_ops.c +++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c @@ -1077,6 +1077,8 @@ void sd_int_dpc(struct adapter *adapter) } else { rtw_c2h_wk_cmd(adapter, (u8 *)c2h_evt); } + } else { + kfree(c2h_evt); } } else { /* Error handling for malloc fail */