OpenZFS 8046 - Let calloc() do the multiplication in libzfs_fru_refresh

Authored by: Pedro Giffuni <pfg@freebsd.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov>

OpenZFS-issue: https://www.illumos.org/issues/8046
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/3a3c0d5
Closes #5989
This commit is contained in:
Pedro Giffuni 2017-04-07 13:36:06 -07:00 committed by Brian Behlendorf
parent c0c8cc7b43
commit f9ea47db3d

View File

@ -284,7 +284,7 @@ libzfs_fru_refresh(libzfs_handle_t *hdl)
if (hdl->libzfs_fru_hash == NULL &&
(hdl->libzfs_fru_hash =
calloc(ZFS_FRU_HASH_SIZE * sizeof (void *), 1)) == NULL)
calloc(ZFS_FRU_HASH_SIZE, sizeof (void *))) == NULL)
return;
/*