Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp56611lfe; Fri, 15 Apr 2022 19:17:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD26YMz31i10C8HP1My7R1UrE/T0f2u9TZkhshXHVO8B22ekQyEzvYGC81vi2f4FFB95WK X-Received: by 2002:a65:618d:0:b0:39e:2d10:6d69 with SMTP id c13-20020a65618d000000b0039e2d106d69mr1372184pgv.468.1650075465799; Fri, 15 Apr 2022 19:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650075465; cv=none; d=google.com; s=arc-20160816; b=f5ELj4tV1ND/oZnMv7CbRbqxjqKQAsqhIst2NphvuuAhzRvjJM5abnLNrzHoQoDmuc W1iPQwHQihUC7S8HlDcYCkIgRoXCBo4MyVNO7H9Ph7rWLnzvk3wRW8IR2hoorBDZmD1d ayuE41ZSTU8EOEkZ2XnPve9/VzNiNTdLuDrHVdQS4JhyHxeRZc3TyF19G4gNqrp//Pov h52y5kDjsPo8IwEL/mIzE9ExYb8NR3OpCcle+fIrCyHUGdIoJykbYXTkHcPVsERTcdTL tBooSkCiDntwapuu4OmD/j9n9NhKn6C9MNrE8DphVZEfINXXXRTiVHFWywNq25xzscCu MNnQ== 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=A0UfSjDAoLmkLa6fTFXFFMQP6FY+/e+d/uS4kw1zNX0=; b=0HoLIm96gpMP3NkL4qpf+WaCE7esawcmeA4f+W2yg9vuIOCrHSXZ+iUTwqDMVBdaMK Y5TjxwJ6hDz70+lRElK2bWXvhtaj/MyuN7IDrwiUiHpjA1nmsA70VLG6D51VnpGMxHLy KFkwSqFr0pprQ/dGH8kFTe0hNs1j5LevFOY9K9V9JID6PKpgi3AobduuclPwmiDjkvrh elO6tW3ZoQbavonleU/7mqWl/rjsKzj9e3/6nZyf0GqqD1MA6ayKOmTIQWEm3Sr8Xn0z +40YGaizOeu1wQJPwIsau58xB7omLS/2a3Q7R8MVk9DuaLs3fnGlJWB30amLw3O8Aw91 ZMRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TjYxubP+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l19-20020a637013000000b003822f3c78cfsi2870918pgc.683.2022.04.15.19.17.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TjYxubP+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 79A9922321A; Fri, 15 Apr 2022 18:33:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350755AbiDOUKn (ORCPT + 99 others); Fri, 15 Apr 2022 16:10:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245026AbiDOUKj (ORCPT ); Fri, 15 Apr 2022 16:10:39 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0A2DC1C8E for ; Fri, 15 Apr 2022 13:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650053290; x=1681589290; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=toKkPquDR3AGm7Vzv0WyTxG86xwqQ846wTwgVCvCxd0=; b=TjYxubP+4bWZHk/42RRqHFwDHGUcu7gQLdBL7EtLbt6SsBT2rMxpC9gI y8RRrcnfHoL0+U0T3iR/f9P852LFB3zM2bFrlvGf7CfH3dDVov0QMcJcR 78vqoJNx33tzAjonmc16OZxoNKXTRl8/76mFAMKrkDCJ9kdqUqnUv9ior 9/L9iRCjDljEqw4Hvey+nXQ2bkLX1AJ8KGy3pkl8TrtyQ771FaNfsHOnb da/UGQiTU8UX9n/uQsS4lL7WbYZRzBpmFU0i5FW/nsV6KpOd8XV5E7xtU J/EEikWtWoHeatqdHmqeQxcgC3MMVxfmCY/YUuIWEsIxfjYx90e8EwyGj Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10318"; a="262078943" X-IronPort-AV: E=Sophos;i="5.90,263,1643702400"; d="scan'208";a="262078943" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2022 13:08:09 -0700 X-IronPort-AV: E=Sophos;i="5.90,263,1643702400"; d="scan'208";a="574510686" Received: from rhweight-mobl.amr.corp.intel.com (HELO rhweight-mobl.ra.intel.com) ([10.209.98.156]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2022 13:08:09 -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@intel.com, basheer.ahmed.muddebihal@intel.com, tianfei.zhang@intel.com, Russ Weight Subject: [PATCH v2 1/8] firmware_loader: Clear data and size in fw_free_paged_buf Date: Fri, 15 Apr 2022 13:07:58 -0700 Message-Id: <20220415200805.610339-2-russell.h.weight@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220415200805.610339-1-russell.h.weight@intel.com> References: <20220415200805.610339-1-russell.h.weight@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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. Signed-off-by: Russ Weight --- v1: - No change from RFC patch v2: - No change --- 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