Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp4085425pxb; Tue, 19 Apr 2022 16:45:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOUQNc4REuLyoaSWlemxcZqtwj7c+FQ/MXRee+FbW60euc4NIIj1n6gYEKfpMMV8k4ONGm X-Received: by 2002:aa7:c38f:0:b0:41d:82c7:7751 with SMTP id k15-20020aa7c38f000000b0041d82c77751mr20498730edq.215.1650411908224; Tue, 19 Apr 2022 16:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650411908; cv=none; d=google.com; s=arc-20160816; b=rvPwjTlcDVSXrys3WMHE9hpzqRo/XRxCMJ5c+jAKZoIyO8s3RShYItQMiGTKp5H0Fq 6z0d+f4ymL2RTC9ODfdNEToaCIihOYRbkllhLjpzcyft7IXqD3coRLOARAcffr7Irf/C whw4D4IdrgMtGX+hmnJt1Svan0GVS+s0udokdiGriMYnh2xkwYboTOplnw/k7G3GqPLj +MXFzIQ/VMWzBvT6lsvzkr7DLYfiXz2mh7qnBA9l41nQjk/7qcCsQKUG0lHiq1vBlfKE 4SkEk3fdN/yEF6gF9b+fJYJcDUqszIqrnAIGs9KHbVJjSdypToL6azqEyuRCvpG3AHOt /Y6w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vkEiacs2ijyTkJ/Fm9Wh8R0zpyEFue6MUqXF1WAuL3Q=; b=mdsM1uJbH2/K0LJVuzCKzs/66x0bhqFYHendzquX4JiTg1J74I/T8TBknL4v6anO/Y FpUxa/HUsqlD9nhodskfqXX3ndlF8xCeeC8PXXYtG7Aps3pxiPRjsxPUcmR75QStoZdC fMGHvcpHYuF/tSWxvPWPEcg8K6MSvOZ/9gmG0y4D8holkLbGmbzaHmMk7RZxcPq5LfXC LWStvecj5K4XJDoAdQvYujVCzkRXc74qqQ9yXc0IJtACvNY+GSzMoI9JoHVMRffvH3Pf rSfWi+5ZZNctp3jWFuLsVKogGmPzGEdE7bKUxc/pD7BupIOgiEzsQdc/a6R60xR4js08 L+Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="KUeE4O/7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q23-20020a1709060f9700b006e7f86398c4si511733ejj.669.2022.04.19.16.44.44; Tue, 19 Apr 2022 16:45:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="KUeE4O/7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232037AbiDRWkv (ORCPT + 99 others); Mon, 18 Apr 2022 18:40:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231882AbiDRWkr (ORCPT ); Mon, 18 Apr 2022 18:40:47 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 331FB22B2A for ; Mon, 18 Apr 2022 15:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650321487; x=1681857487; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UBJF5Wi+Yd2SNxtTLMuxXWtbQpA0OTdemWsHSiEjzXk=; b=KUeE4O/7y9RWi8apsU+nNf9ej6IB68hArlDMsrg/0GKQrjwYstx1zFQp P0d6Kj5nIZBWoRd8oFyevL8VV7VvbqjAM0v4Jdubc5aiCUuOagyJTLiFY IQozUhkAH0rg6a9mWlEj+MBPSnWfmvnSnCKcB60X+7m4EGMFnl5FzV7NE I7OVR35a9+iAPBw2y1hHGhZ1AL0Xaods23UeKb0X2MrezcjhH8aLm1kc/ 3rs3Z5eTDYkngpadj54rC2Jngve/GSi+Ztif4/npOIqSA4ppAWaK0XBLW p73plONpqvURgvOeph2QezP+RW6n+BZWZ5AWqmOouZqMld9DWEkxBrtjl A==; X-IronPort-AV: E=McAfee;i="6400,9594,10321"; a="243557436" X-IronPort-AV: E=Sophos;i="5.90,271,1643702400"; d="scan'208";a="243557436" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 15:38:05 -0700 X-IronPort-AV: E=Sophos;i="5.90,271,1643702400"; d="scan'208";a="509907081" Received: from rhweight-mobl.amr.corp.intel.com (HELO rhweight-mobl.ra.intel.com) ([10.209.35.137]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 15:38:04 -0700 From: Russ Weight To: mcgrof@kernel.org, rafael@kernel.org, linux-kernel@vger.kernel.org Cc: trix@redhat.com, lgoncalv@redhat.com, yilun.xu@intel.com, hao.wu@intel.com, matthew.gerlach@linux.intel.com, basheer.ahmed.muddebihal@intel.com, tianfei.zhang@intel.com, Russ Weight Subject: [PATCH v3 1/8] firmware_loader: Clear data and size in fw_free_paged_buf Date: Mon, 18 Apr 2022 15:37:46 -0700 Message-Id: <20220418223753.639058-2-russell.h.weight@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220418223753.639058-1-russell.h.weight@intel.com> References: <20220418223753.639058-1-russell.h.weight@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The fw_free_paged_buf() function resets the paged buffer information in the fw_priv data structure. Additionally, clear the data and size members of fw_priv in order to facilitate the reuse of fw_priv. This is being done in preparation for enabling userspace to initiate multiple firmware uploads using this sysfs interface. Reviewed-by: Luis Chamberlain Signed-off-by: Russ Weight --- v1: - No change from RFC patch v2: - No change v3: - Added Reviewed-by tag --- drivers/base/firmware_loader/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index 94d1789a233e..2cc11d93753a 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -253,6 +253,8 @@ void fw_free_paged_buf(struct fw_priv *fw_priv) fw_priv->pages = NULL; fw_priv->page_array_size = 0; fw_priv->nr_pages = 0; + fw_priv->data = NULL; + fw_priv->size = 0; } int fw_grow_paged_buf(struct fw_priv *fw_priv, int pages_needed) -- 2.25.1