Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3761737pxt; Tue, 10 Aug 2021 10:42:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3S0kky/evNyZKYtONt83MOi4Oif0vE1uZUDhT3WAVlZP9k1tZwPq0CcWjM5zSkKRh5EYZ X-Received: by 2002:a5d:9b8b:: with SMTP id r11mr692539iom.26.1628617377484; Tue, 10 Aug 2021 10:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617377; cv=none; d=google.com; s=arc-20160816; b=MsGvQmYiOsDfYYkgK+SCaAT8UHlYq2HtR+dUa+oUCU2xC2nF7mlYRmDLFnOVmaOZm+ /+57k5oqUApkVMHFDazPlgfb5+5Ulqc2Od/CyC5KLO3K1ZlIY8h+SYYKCS2lu9gDoc0w SNnptDQJWYSL0rGJ53gNP9Hyl0HLKQkFvMzQcOi8WrdRtDpknTgCivgICG4SqvhHhVNp oYPLM+MIH9DpToSJnsVrOmBFksRD5VyOp8/hzEizsM4IlB8JKRee5WbVwYVif2Ei72GR 3Rb44B+zzb6WEpPdo8v8yWeXbTBBvuAtDUll8N77Ci8Fg8rOiV5mWEnRBVCfHfSjw7kO mIMQ== 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=Gtg3N0PP88Q687rS435C6hq82mtS8uRFNGSXnDjrB0s=; b=vFHEk2DmYqEohqEZaT7l0l1IADiFjLJFLt59qDS/TzcnltbV5H8krjGmCFZYb2Q/Jk pTMV3glXQAk7fmPZnPwo5otqih3NgRC4kBpy6BJdvKRxBhZvQMilxprCEAtf/Vk1IJ/M +avkT8rLNCTORIMCRA8B0k2+mXzfErsHPak3WSesS4yDo+HonF2GGarVPkJ4WXACGn9U 2MQeRO5g/4XlBrDffICKuoUfjE12kXaLdVJUVG9WcC2f/iOZIlwLnrQcSyCHJ9EcxnmZ U6TQqI4UObY+FAACaLRCt8iFpufiSMZa9rJCkIvINLVKcyNrwmpNAtT0+0VIJdghA9mC FNbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="2a/SKFtF"; 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 d2si14509714ioi.55.2021.08.10.10.42.30; Tue, 10 Aug 2021 10:42:57 -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="2a/SKFtF"; 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 S235282AbhHJRmJ (ORCPT + 99 others); Tue, 10 Aug 2021 13:42:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:42778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235014AbhHJRjC (ORCPT ); Tue, 10 Aug 2021 13:39:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7FFEA6113D; Tue, 10 Aug 2021 17:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617007; bh=uPJHPIMaAQHhqYTIRhSwl3OZrLSgpFsc9imL+CpRXl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2a/SKFtFZFmCaio0j2dHZ/p4ldPwerb/Rq4BTjYjwaGTe4FbzOqWrl8o5aoogzIhW LQpPnttSUy1HXVvkpe5Llrs31BNH5l5DQufHQZpbGtC2+OoERBDH9hM6jKIwU4m6tM SnjMmtH9LQq5Ai/kdmhKzCCNftGIABhQjceDgc90= 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 5.4 56/85] staging: rtl8723bs: Fix a resource leak in sd_int_dpc Date: Tue, 10 Aug 2021 19:30:29 +0200 Message-Id: <20210810172950.132127247@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172948.192298392@linuxfoundation.org> References: <20210810172948.192298392@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 @@ -1033,6 +1033,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 */