Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp593877pxb; Fri, 22 Apr 2022 07:31:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf8U3Np/oButiwEnTaaYiWMzK6yLOMCBDlg2po+u9fGKRC4OmtGmQneM1+blS3TLBbQmeN X-Received: by 2002:a05:6402:254e:b0:424:244:faf with SMTP id l14-20020a056402254e00b0042402440fafmr5238953edb.260.1650637875104; Fri, 22 Apr 2022 07:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650637875; cv=none; d=google.com; s=arc-20160816; b=IVwxkruBqhb9T2oLgMeGm4Tseve2ostkEgXtIe7EiY6/YllR9G5m//1ZeiBRjz9RH4 pXGAU/rxOFQgeKWx6L/PS6T5zFq5HSyw1qDIyyCsKZN/9XQAuVvfW5QPvq6PZ8+fHwnq iRX9Phg1xdVk7xuoTCeWa4smxm5U8t6WjToqjhRONaOzKIZLKYzlkge8XLjza+NwMpCK b4Hs6DtalFeusUkiHkFpGQ/bUifz8Oa4zosJXzSzKPCbOAsJds21rweTS64Y6oD8md5P Thi1DKmi/1tUxa2rN3UAS8uzbotfdKTprw4983m8AmF9+9Fps37XSqiR9b10IB+5amil +UoA== 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=L0AS1U+PR2u4L50mBxI0Yu6Afy8zAyl6SSxE3WVybLY=; b=duaAML3GPcvpux2t9daL5mb8beuhnsQMPPUor6xVjAFfPYfCxYX3DIF+g1NYeNqhxI uu9kztCE16FaUTYHxnCcqC/k//VUkylEaLV9wd2/zn/e8b39WkHp0Cmv3JTuS26EHBus ZP2Bz6dY8jsO2oJCGVldIWTjHB5yq2j10dD6nUbwTbuV0lwKukxO9XZyIEh2SR1soHFA 9i8GHfOC1CTn3DABVsFjmVL0eBuM7swmST8lOFsjMLS3fZdWNXComKfWz2tfSjFitMzz nIpdRUuLfuEpaZHqgXTb9dPOKgxpWPmvY31q/YeeBQlwVY8OKYsB5/UWO/DC8SfMKZn4 tQiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZZv4q1ar; 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 j6-20020a17090643c600b006e0af1565c3si6844841ejn.316.2022.04.22.07.30.51; Fri, 22 Apr 2022 07:31:15 -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=ZZv4q1ar; 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 S1441938AbiDUVZE (ORCPT + 99 others); Thu, 21 Apr 2022 17:25:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441929AbiDUVZA (ORCPT ); Thu, 21 Apr 2022 17:25:00 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D11A04BFE3 for ; Thu, 21 Apr 2022 14:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650576128; x=1682112128; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bhT7Q8/ADSBtr63pT3T/HE2mvjBAH3w7Yptf5Y/H4HU=; b=ZZv4q1arXrsizz7D1pJHKVn61Gz4Mm92zoKgIUcjGYDwXH2QDd3ADXxc h59YW2SlJ9c4rYTGdTMu0mXxSl1ve5gLhPikdmcjJ2bzei6l73X4bA+wo 9UG9eefYzPNZTo8wFfV4M8ZmuxocqbxT38NphPM3D4ytvFBMil2bj2urc +H5NJ0ChkGjiPE+citzS50HhEZrp1/2QMbaMHfzweptktYZER7bIP38CC AhZcJp0ds9AZ4wIumnNWjpMm+6DKFLevMU6mYGMzzKzPUwTTcPwpKb7tt 0rnhWGlp1U+pPV43fp/XK2cI2/P6hzvQIrJW8ktwOJ1y6OWdLhVXSIgPF w==; X-IronPort-AV: E=McAfee;i="6400,9594,10324"; a="350924990" X-IronPort-AV: E=Sophos;i="5.90,279,1643702400"; d="scan'208";a="350924990" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2022 14:22:08 -0700 X-IronPort-AV: E=Sophos;i="5.90,279,1643702400"; d="scan'208";a="658704071" Received: from rhweight-mobl.amr.corp.intel.com (HELO rhweight-mobl.ra.intel.com) ([10.209.56.239]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2022 14:22:07 -0700 From: Russ Weight To: mcgrof@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, linux-kernel@vger.kernel.org Cc: trix@redhat.com, marpagan@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 v5 1/8] firmware_loader: Clear data and size in fw_free_paged_buf Date: Thu, 21 Apr 2022 14:21:57 -0700 Message-Id: <20220421212204.36052-2-russell.h.weight@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421212204.36052-1-russell.h.weight@intel.com> References: <20220421212204.36052-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_NONE,SPF_NONE 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 Reviewed-by: Tianfei zhang Tested-by: Matthew Gerlach Signed-off-by: Russ Weight --- v1: - No change from RFC patch v2: - No change v3: - Added Reviewed-by tag v4: - Added Reviewed-by tag v5: - Added Tested-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