* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
*/
#include <sys/zfs_context.h>
nvpair_name(perm_name));
if (error)
return (-1);
- } while ((perm_name = nvlist_next_nvpair(perms, perm_name)));
- } while ((who = nvlist_next_nvpair(nvp, who)));
+ } while ((perm_name = nvlist_next_nvpair(perms, perm_name))
+ != NULL);
+ } while ((who = nvlist_next_nvpair(nvp, who)) != NULL);
return (0);
}