]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
firmware_loader: Clear data and size in fw_free_paged_buf
authorRuss Weight <russell.h.weight@intel.com>
Thu, 21 Apr 2022 21:21:57 +0000 (14:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Apr 2022 15:13:54 +0000 (17:13 +0200)
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>
drivers/base/firmware_loader/main.c

index 74830aeec7f6562f7e3b592b9a21f800170e2e0f..3d9b2074912df517ede11de23fbd13571fe02327 100644 (file)
@@ -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)