mirror of https://github.com/torvalds/linux.git
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>
This commit is contained in:
parent
42cd402b8f
commit
4ac4a90d77
|
|
@ -254,6 +254,8 @@ void fw_free_paged_buf(struct fw_priv *fw_priv)
|
||||||
fw_priv->pages = NULL;
|
fw_priv->pages = NULL;
|
||||||
fw_priv->page_array_size = 0;
|
fw_priv->page_array_size = 0;
|
||||||
fw_priv->nr_pages = 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)
|
int fw_grow_paged_buf(struct fw_priv *fw_priv, int pages_needed)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue