Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3765767pxt; Tue, 10 Aug 2021 10:48:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1A7bmIxI68tvEjS8rYpncZfM34Uu+fwEkR+ZMy2KKxavZvq95tHjMlakbZq5YNo1bKWcW X-Received: by 2002:a92:cb52:: with SMTP id f18mr454800ilq.97.1628617718979; Tue, 10 Aug 2021 10:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617718; cv=none; d=google.com; s=arc-20160816; b=FHqF/ECKfPfhBH8Zgz4ZGIK0nOoozeKIJPv7VN3HNXmUU9qaqx4xZNdGcIrofvmQwp zMa8eWBCKBnKZmOqJxVPN/896srgpVwf9yVAXqamsB3A4oUtvQiajc4+iZYJ2m1B1k+D s72V/svuzkFIfjZyQVi4yhSSV1tVNuLkkkNNUlU6vjptIio5GpiXybzoJzgM9N6N/6us TtsxfuD6fswMfLeq6X7cxtf/nxpNv07Neb2z8t+ItIV1rIn1MGWdgoO0wIqVNVyqFWqW WWKQEQ/Qgogz+rahwi0mYNnCAMgRoFVLPILoOtFk5vh+KEDJL9Asj2VrACjlcaqdrLiM bR3A== 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=kzq3vg8AwmFK/j0mIDbDLeNZhEPXASiXE+iOhqDgCH0=; b=ZjDPlUbqX8BCrM0eOrviANp0neWExFbqPkXWd9xENmiLY1y/Ns8A+b47Q1C/q0oFCE CyES/ELkHLNAvZlRbve+scJurzJGY2N0GA/wGh0zpuBFb1uLOQbU6LylDlJ2NH3xaIWM gvs+kIlJwNQRpmMZ1ueUjOOK0RevCfsWtQNdJKyA5l8HmFKsmft9erjKGuEmv+yu5nKn ecJptm1gD45aaPVrBQeeUI5AdIw6Eu1x2FaAZwv/hEMC5eEgOilSxZtATloRHKq2wnzT xypqFhfZtV6aE6rbWsnalD6W/7WI6rgr1ugDTH4Z5MqTFLVSjng1yWqiU26AFzvljrgi S0Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zGsDqEjb; 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 x26si11398473jai.112.2021.08.10.10.48.27; Tue, 10 Aug 2021 10:48:38 -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=zGsDqEjb; 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 S235346AbhHJRsE (ORCPT + 99 others); Tue, 10 Aug 2021 13:48:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:41108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236440AbhHJRou (ORCPT ); Tue, 10 Aug 2021 13:44:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6C11561052; Tue, 10 Aug 2021 17:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617193; bh=XkuHXJeEOLE1rHim8j/0K0cJkv4xXMTyjIm6eI6jOQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zGsDqEjbslCrfvm2g6bhW4sz7ZSt5NoXi5wfPFv+cHwauQ9exS2VpWMkhbljQZXNV uBAjHtM5T7bFq2bcFfap+6amK3yOVa/XUqSUo2ylAL99dw2xEEEWydMKMLYtok2Kf3 z7+wu27XYVruS8RorQ+0jqRC4u7mYsoXRaQXC/QY= 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.10 087/135] staging: rtl8723bs: Fix a resource leak in sd_int_dpc Date: Tue, 10 Aug 2021 19:30:21 +0200 Message-Id: <20210810172958.703790771@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172955.660225700@linuxfoundation.org> References: <20210810172955.660225700@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 @@ -989,6 +989,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 */