summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-22 11:40:40 +0200
committerToomas Soome <tsoome@me.com>2019-07-03 08:23:04 +0300
commit29d9204108fb7f70b8c101eae01e62aba6e0b901 (patch)
treef9cf81892d47dd402d720b80a18672ad322a2fde /usr
parent2c69a708251dedcd11947bd4469eb7d0f361ac30 (diff)
downloadillumos-joyent-29d9204108fb7f70b8c101eae01e62aba6e0b901.tar.gz
11144 libpool: NULL pointer errors
Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr')
-rw-r--r--usr/src/lib/libpool/common/pool.c16
-rw-r--r--usr/src/lib/libpool/common/pool_internal.h16
2 files changed, 14 insertions, 18 deletions
diff --git a/usr/src/lib/libpool/common/pool.c b/usr/src/lib/libpool/common/pool.c
index bcd8c9af28..9e469685f3 100644
--- a/usr/src/lib/libpool/common/pool.c
+++ b/usr/src/lib/libpool/common/pool.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -355,7 +353,7 @@ pool_base_info(const pool_elem_t *pe, char_buf_t *cb, int deep)
}
if (append_char_buf(cb, "\n%s%s", cb->cb_tab_buf,
- pool_elem_class_string(pe)) == PO_FAIL) {
+ pool_elem_class_string(pe)) == PO_FAIL) {
return (NULL);
}
@@ -923,7 +921,7 @@ pool_put_property(pool_conf_t *conf, pool_elem_t *pe, const char *name,
if (TO_CONF(pe) != conf) {
pool_seterror(POE_BADPARAM);
- return (NULL);
+ return (PO_FAIL);
}
/* Don't allow (re)setting of the "temporary" property */
@@ -1103,7 +1101,7 @@ pool_rm_property(pool_conf_t *conf, pool_elem_t *pe, const char *name)
if (TO_CONF(pe) != conf) {
pool_seterror(POE_BADPARAM);
- return (NULL);
+ return (PO_FAIL);
}
/* Don't allow removal of the "temporary" property */
@@ -1673,7 +1671,7 @@ pool_conf_update(const pool_conf_t *conf, int *changed)
int
pool_walk_properties(pool_conf_t *conf, pool_elem_t *elem, void *arg,
int (*prop_callback)(pool_conf_t *, pool_elem_t *, const char *,
- pool_value_t *, void *))
+ pool_value_t *, void *))
{
return (pool_walk_any_properties(conf, elem, arg, prop_callback, 0));
}
@@ -1699,7 +1697,7 @@ free_value_list(int npvals, pool_value_t **pvals)
int
pool_walk_any_properties(pool_conf_t *conf, pool_elem_t *elem, void *arg,
int (*prop_callback)(pool_conf_t *, pool_elem_t *, const char *,
- pool_value_t *, void *), int any)
+ pool_value_t *, void *), int any)
{
pool_value_t **pvals;
int i;
@@ -1768,7 +1766,7 @@ pool_walk_any_properties(pool_conf_t *conf, pool_elem_t *elem, void *arg,
if (any == 1 || prop_is_hidden(&props[i]) == PO_FALSE) {
if (props[i].pp_op.ppo_get_value) {
if (pool_value_set_name(pvals[j],
- props[i].pp_pname) == PO_FAIL) {
+ props[i].pp_pname) == PO_FAIL) {
free_value_list(npvals, pvals);
return (PO_FAIL);
}
@@ -2359,7 +2357,7 @@ setup_transfer(pool_conf_t *conf, pool_resource_t *src, pool_resource_t *tgt,
#endif /* DEBUG */
if (*src_size - size < src_min ||
(resource_is_default(tgt) == PO_FALSE &&
- *tgt_size + size > tgt_max)) {
+ *tgt_size + size > tgt_max)) {
pool_seterror(POE_INVALID_CONF);
return (XFER_FAIL);
}
diff --git a/usr/src/lib/libpool/common/pool_internal.h b/usr/src/lib/libpool/common/pool_internal.h
index e172d23af4..dbf01c475a 100644
--- a/usr/src/lib/libpool/common/pool_internal.h
+++ b/usr/src/lib/libpool/common/pool_internal.h
@@ -26,8 +26,6 @@
#ifndef _POOL_INTERNAL_H
#define _POOL_INTERNAL_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <libnvpair.h>
#include <stdarg.h>
#include <sys/pool.h>
@@ -137,7 +135,7 @@ typedef struct char_buf
* Initialize a pool_value_t
*/
#define POOL_VALUE_INITIALIZER /* = DEFAULT POOL VALUE */ \
- {POC_INVAL, NULL, NULL }
+ {POC_INVAL, NULL, 0 }
struct pool_value {
pool_value_class_t pv_class; /* Value type */
@@ -254,7 +252,7 @@ extern int resource_get_pinned(const pool_resource_t *,
*/
extern char *elem_get_name(const pool_elem_t *);
extern id_t elem_get_sysid(const pool_elem_t *);
-extern int elem_is_default(const pool_elem_t *);
+extern int elem_is_default(const pool_elem_t *);
extern boolean_t elem_is_tmp(const pool_elem_t *);
extern const pool_elem_t *get_default_elem(const pool_elem_t *);
extern int qsort_elem_compare(const void *, const void *);
@@ -341,7 +339,7 @@ extern int append_char_buf(char_buf_t *, const char *, ...);
* Internal functions for use with pool values.
*/
extern int pool_value_equal(pool_value_t *, pool_value_t *);
-extern int pool_value_from_nvpair(pool_value_t *, nvpair_t *);
+extern int pool_value_from_nvpair(pool_value_t *, nvpair_t *);
/*
* Check to ensure that the supplied string is a valid name for a pool
@@ -398,11 +396,11 @@ extern int pool_knl_update(pool_conf_t *, int *);
/*
* Resource property functions
*/
-extern int resource_is_default(const pool_resource_t *);
-extern int resource_is_system(const pool_resource_t *);
-extern int resource_can_associate(const pool_resource_t *);
+extern int resource_is_default(const pool_resource_t *);
+extern int resource_is_system(const pool_resource_t *);
+extern int resource_can_associate(const pool_resource_t *);
extern const pool_resource_t *get_default_resource(const pool_resource_t *);
-extern pool_resource_t *resource_by_sysid(const pool_conf_t *, id_t,
+extern pool_resource_t *resource_by_sysid(const pool_conf_t *, id_t,
const char *);
/*