summaryrefslogtreecommitdiff
path: root/drivers/base/firmware_loader
diff options
context:
space:
mode:
authorRuss Weight <russell.h.weight@intel.com>2022-04-22 00:21:57 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-22 18:13:54 +0300
commit4ac4a90d7728b161f0ce0527feb19d60af961dfb (patch)
tree38a8bb620434346d89d06afa43e4b059a0872c25 /drivers/base/firmware_loader
parent42cd402b8fd4672b692400fe5f9eecd55d2794ac (diff)
downloadlinux-4ac4a90d7728b161f0ce0527feb19d60af961dfb.tar.xz
firmware_loader: Clear data and size in fw_free_paged_buf
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 <mcgrof@kernel.org> Reviewed-by: Tianfei zhang <tianfei.zhang@intel.com> Tested-by: Matthew Gerlach <matthew.gerlach@linux.intel.com> Signed-off-by: Russ Weight <russell.h.weight@intel.com> Link: https://lore.kernel.org/r/20220421212204.36052-2-russell.h.weight@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_loader')
-rw-r--r--drivers/base/firmware_loader/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
index 74830aeec7f6..3d9b2074912d 100644
--- a/drivers/base/firmware_loader/main.c
+++ b/drivers/base/firmware_loader/main.c
@@ -254,6 +254,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)