mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-27 04:32:16 +03:00
Fix calloc(3) arguments order
calloc(3) takes `nelem` (or `nmemb` in glibc) first, and then size of elements. No difference expected for having these in reverse order, however should follow the standard. http://pubs.opengroup.org/onlinepubs/009695399/functions/calloc.html Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com> Closes #7405
This commit is contained in:
committed by
Brian Behlendorf
parent
7403d0743e
commit
8111eb4abc
@@ -466,7 +466,7 @@ make_dataset_handle(libzfs_handle_t *hdl, const char *path)
|
||||
{
|
||||
zfs_cmd_t zc = {"\0"};
|
||||
|
||||
zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
|
||||
zfs_handle_t *zhp = calloc(1, sizeof (zfs_handle_t));
|
||||
|
||||
if (zhp == NULL)
|
||||
return (NULL);
|
||||
@@ -493,7 +493,7 @@ make_dataset_handle(libzfs_handle_t *hdl, const char *path)
|
||||
zfs_handle_t *
|
||||
make_dataset_handle_zc(libzfs_handle_t *hdl, zfs_cmd_t *zc)
|
||||
{
|
||||
zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
|
||||
zfs_handle_t *zhp = calloc(1, sizeof (zfs_handle_t));
|
||||
|
||||
if (zhp == NULL)
|
||||
return (NULL);
|
||||
@@ -510,7 +510,7 @@ make_dataset_handle_zc(libzfs_handle_t *hdl, zfs_cmd_t *zc)
|
||||
zfs_handle_t *
|
||||
make_dataset_simple_handle_zc(zfs_handle_t *pzhp, zfs_cmd_t *zc)
|
||||
{
|
||||
zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
|
||||
zfs_handle_t *zhp = calloc(1, sizeof (zfs_handle_t));
|
||||
|
||||
if (zhp == NULL)
|
||||
return (NULL);
|
||||
@@ -527,7 +527,7 @@ make_dataset_simple_handle_zc(zfs_handle_t *pzhp, zfs_cmd_t *zc)
|
||||
zfs_handle_t *
|
||||
zfs_handle_dup(zfs_handle_t *zhp_orig)
|
||||
{
|
||||
zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
|
||||
zfs_handle_t *zhp = calloc(1, sizeof (zfs_handle_t));
|
||||
|
||||
if (zhp == NULL)
|
||||
return (NULL);
|
||||
@@ -607,7 +607,7 @@ zfs_handle_t *
|
||||
make_bookmark_handle(zfs_handle_t *parent, const char *path,
|
||||
nvlist_t *bmark_props)
|
||||
{
|
||||
zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
|
||||
zfs_handle_t *zhp = calloc(1, sizeof (zfs_handle_t));
|
||||
|
||||
if (zhp == NULL)
|
||||
return (NULL);
|
||||
|
||||
@@ -1673,7 +1673,7 @@ zpool_clear_label(int fd)
|
||||
return (0);
|
||||
size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t);
|
||||
|
||||
if ((label = calloc(sizeof (vdev_label_t), 1)) == NULL)
|
||||
if ((label = calloc(1, sizeof (vdev_label_t))) == NULL)
|
||||
return (-1);
|
||||
|
||||
for (l = 0; l < VDEV_LABELS; l++) {
|
||||
|
||||
Reference in New Issue
Block a user