aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormwleeds@mailtundra.com <mwleeds@mailtundra.com>2024-04-06 18:47:26 -0700
committerTom Rini <trini@konsulko.com>2024-04-17 10:08:51 -0600
commit6bbd7e820d3eba14eceb46c3bb42bfad1af6be3f (patch)
tree7bd3072f8d76e20715476721bb88730e846a0366
parent0c17f85710a70a24ec19852a2f6f0749e807656f (diff)
downloadu-boot-6bbd7e820d3eba14eceb46c3bb42bfad1af6be3f.zip
u-boot-6bbd7e820d3eba14eceb46c3bb42bfad1af6be3f.tar.gz
u-boot-6bbd7e820d3eba14eceb46c3bb42bfad1af6be3f.tar.bz2
zfs: Add a comment to clarify nvlist memory layout
Signed-off-by: Phaedrus Leeds <mwleeds@mailtundra.com>
-rw-r--r--fs/zfs/zfs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c
index 14779de..61d58fc 100644
--- a/fs/zfs/zfs.c
+++ b/fs/zfs/zfs.c
@@ -1617,6 +1617,11 @@ zfs_nvlist_lookup_nvlist(char *nvlist, char *name)
&size, 0);
if (!found)
return 0;
+
+ /* Allocate 12 bytes in addition to the nvlist size: One uint32 before the
+ * nvlist to hold the encoding method, and two zero uint32's after the
+ * nvlist as the NULL terminator.
+ */
ret = calloc(1, size + 3 * sizeof(uint32_t));
if (!ret)
return 0;