zfs: Add a comment to clarify nvlist memory layout
Signed-off-by: Phaedrus Leeds <mwleeds@mailtundra.com>
This commit is contained in:

committed by
Tom Rini

parent
0c17f85710
commit
6bbd7e820d
@@ -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;
|
||||
|
Reference in New Issue
Block a user