Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2565175rdb; Mon, 5 Feb 2024 10:15:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDtSzf8VbzCxikGWW4/3fMYk7TsN08kVXwNASog+iJutZ9JZFcpZRYAgOYew3+vmjR0CEC X-Received: by 2002:a05:6402:2cc:b0:560:6458:fd1c with SMTP id b12-20020a05640202cc00b005606458fd1cmr478968edx.8.1707156944277; Mon, 05 Feb 2024 10:15:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707156944; cv=pass; d=google.com; s=arc-20160816; b=XpqamMKYZ2n7edxvOGAMx4RNrc4O8G2xyhrs6p/+D1oYz9etLYuzm7+qQX5bCzJN3b wIbFKdY9x2iAfD/PCTCqC3ha+BDIT+zrtd5LjLt5xK9scXbL9mzQXjtUAkWj4F/7Ih9t 0+kDoMdEE7FiLzRPJ9ajzFdNFmjRkNmI+zs8GtumoeE9nj/Tj4nE+8uMNWqynDHeSvYW OBuDd4F6wBHuNMviaRaIk3XQX3yycNOkrxjsrtJWNH7qcW8re16bCBEgRpST/rOOqZdN DHi8LIkgGCxC4p0SyHa82lc9+Y3Hl7/Wqe2U0X2xPArsX+j9EMmG0T6S/K+4asdGHXlF s1LA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=5yim/0YHNUFBgjAQhHwn6HiiygUQfEuPVK1kbco15SU=; fh=u175bOadOw07DRiWVZtbss3aAH+fu4AJGAGktA8DboQ=; b=eZwAzciebwIw8mBuNuhCPMb2mkfIUZo2WoXcFGXZUV+ChzNgqdjsDZfycuXuniK/hm jUBZN2dH/CJFuKJBmYS7JXrVoS1C3qiCn4JySx1uHepAeXAviHOWmTZwy5CSrQ91Hh98 VSEXzpJTAzZNlSm3GG2juuabfa5LqujByN8gbHWGPY8r3ClEHlPVcZaJUbtYbZeF6l1o 226iFSGK4xQ6DBzI0heFax+VNmw8tawr+8KDBsTHH/W5x5t/5Ca4j0LNCgxnBsIxQbRl p7V5AKxsOZTPlgofasQZJr+3PbhGLtahmz97qv0GR65QcHTXZNdJjgxsm8G0LlS3TGNI n98A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rMApkbRZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXRsOvwwq/zElZUrv5uY4oXu4pIPfbVKlYqsitMQ/XzwDRA1EwpyJsTx4dGaleqe29BpvgkxJI0Ywum6MKUggnx4j1ZsvjGRGFEiyRbnw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f17-20020a056402151100b005607847d045si137132edw.559.2024.02.05.10.15.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 10:15:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rMApkbRZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-3146-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3146-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C876B1F242F1 for ; Mon, 5 Feb 2024 18:15:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7326A481BF; Mon, 5 Feb 2024 18:15:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rMApkbRZ" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BBD9481B1; Mon, 5 Feb 2024 18:15:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707156938; cv=none; b=TVL2TsvfBpcdM8b1ZXOzyAKFZaCsLFbuxq8JYNwQQeOGVjrw40PsTj7wTMtz4+EX6MyiTxccWk1g3//iBALisgnPRPhJ3NLs8yqdXIY3uQuVHJgzGK9gyDk5m/fcv8Zho7UOCt/AWd/Dfmam19lG+2+0xZi89x31EZLRxUbRqtw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707156938; c=relaxed/simple; bh=nmCN9F4V3Q87GixPq9VeXFDsHOAxfspOp7xM3WpI5IQ=; h=Content-Type:MIME-Version:Subject:From:In-Reply-To:References:To: Cc:Message-ID:Date; b=hKCYh8RgzF4+1c2FJv6cnTT/Mo98ZPigd/VWahYkiQICHIPsBE4r0DzZPe5psXcdmfzhTAGbr5DXpW5uV4LC1JJULeduYjzOrSdlSCJa2RbZCbBKjVNrDkAaJRkAAe1xvDFzD317tZb5vFZ7QYsEAnNjvPmrhXo4gvHc+u7mKOk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rMApkbRZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFFBDC433C7; Mon, 5 Feb 2024 18:15:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707156937; bh=nmCN9F4V3Q87GixPq9VeXFDsHOAxfspOp7xM3WpI5IQ=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=rMApkbRZo9lmpWL/Qxvy5QmaNQYqmpn2SaxNZdNnfuUGi6cNODSgZq5sTAzvCjIKU Cb/4o60mh7raJRAARfluwqxWFI3eGEFpVDv6raxgArwMlYJbnyLUMaFCReHUE+gNGu UVYW5q8BOTWgv3k568vDZyCFpa6++J0rzy2joUWfk1x+uW7gy0WpVVZyVkmjIiUecJ sieU1FzAApe1khXLUh1h2jMtEwbWyPWHSg4JJt5eWofvXm4x7ioT/OpRDJkyGNN10n 8IqaA/SwD/QuGt8kWuGqcTkyDzYJ9A9ROJcK9edrpGUvdrDPcRK/bff9QWQqft/39m 31JggXZv8wnmA== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer() From: Kalle Valo In-Reply-To: <20240126075336.2825608-1-alexious@zju.edu.cn> References: <20240126075336.2825608-1-alexious@zju.edu.cn> To: Zhipeng Lu Cc: alexious@zju.edu.cn, "John W. Linville" , Marcelo Tosatti , libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170715693385.1586694.8942581336995921583.kvalo@kernel.org> Date: Mon, 5 Feb 2024 18:15:35 +0000 (UTC) Zhipeng Lu wrote: > In the for statement of lbs_allocate_cmd_buffer(), if the allocation of > cmdarray[i].cmdbuf fails, both cmdarray and cmdarray[i].cmdbuf needs to > be freed. Otherwise, there will be memleaks in lbs_allocate_cmd_buffer(). > > Fixes: 876c9d3aeb98 ("[PATCH] Marvell Libertas 8388 802.11b/g USB driver") > Signed-off-by: Zhipeng Lu Patch applied to wireless-next.git, thanks. 5f0e4aede01c wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer() -- https://patchwork.kernel.org/project/linux-wireless/patch/20240126075336.2825608-1-alexious@zju.edu.cn/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches