aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs/libzfs_import.c
diff options
context:
space:
mode:
authorTomohiro Kusumi <[email protected]>2018-04-13 02:50:39 +0900
committerBrian Behlendorf <[email protected]>2018-04-12 10:50:39 -0700
commit8111eb4abc96a173845a553dc7d65382398f0683 (patch)
treeeca13f7bad728d865cffe4131dac3962f52b29ef /lib/libzfs/libzfs_import.c
parent7403d0743e2b75b7f5412a14007ba159efb67a7d (diff)
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 <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tomohiro Kusumi <[email protected]> Closes #7405
Diffstat (limited to 'lib/libzfs/libzfs_import.c')
-rw-r--r--lib/libzfs/libzfs_import.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c
index 67bf9b0be..cc9a52a3e 100644
--- a/lib/libzfs/libzfs_import.c
+++ b/lib/libzfs/libzfs_import.c
@@ -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++) {