diff options
author | Toomas Soome <tsoome@me.com> | 2019-01-22 13:15:18 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-06-25 08:26:54 +0300 |
commit | c0e21d6af8bfe88f1c49c7c12d4537b663fe9db9 (patch) | |
tree | 5d936f9b2f7ca82041fedd243d5c08d0f436b246 | |
parent | c8a3ee0e3658c32402e6bd505596d4fa45bfe17c (diff) | |
download | illumos-joyent-c0e21d6af8bfe88f1c49c7c12d4537b663fe9db9.tar.gz |
11150 libdladm: NULL pointer errors
Reviewed by: Ryan Zezeski <rpz@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/lib/libdladm/common/flowprop.c | 6 | ||||
-rw-r--r-- | usr/src/lib/libdladm/common/libdlmgmt.c | 4 | ||||
-rw-r--r-- | usr/src/lib/libdladm/common/libdlwlan.c | 26 | ||||
-rw-r--r-- | usr/src/lib/libdladm/common/linkprop.c | 20 |
4 files changed, 28 insertions, 28 deletions
diff --git a/usr/src/lib/libdladm/common/flowprop.c b/usr/src/lib/libdladm/common/flowprop.c index a0531c8439..6ac9c96be7 100644 --- a/usr/src/lib/libdladm/common/flowprop.c +++ b/usr/src/lib/libdladm/common/flowprop.c @@ -61,7 +61,7 @@ static fpd_setf_t do_set_priority; static fpd_checkf_t do_check_priority; static fprop_desc_t prop_table[] = { - { "maxbw", { "", NULL }, NULL, 0, B_FALSE, + { "maxbw", { "", 0 }, NULL, 0, B_FALSE, do_set_maxbw, NULL, do_get_maxbw, do_check_maxbw}, { "priority", { "", MPL_RESET }, NULL, 0, B_FALSE, @@ -266,7 +266,7 @@ do_get_maxbw(dladm_handle_t handle, const char *flow, char **prop_val, uint_t *val_cnt) { mac_resource_props_t *mrp; - char buf[DLADM_STRSIZE]; + char buf[DLADM_STRSIZE]; dladm_flow_attr_t fa; dladm_status_t status; @@ -360,7 +360,7 @@ do_get_priority(dladm_handle_t handle, const char *flow, char **prop_val, uint_t *val_cnt) { mac_resource_props_t *mrp; - char buf[DLADM_STRSIZE]; + char buf[DLADM_STRSIZE]; dladm_flow_attr_t fa; dladm_status_t status; diff --git a/usr/src/lib/libdladm/common/libdlmgmt.c b/usr/src/lib/libdladm/common/libdlmgmt.c index 4b0753417c..66b7bbce09 100644 --- a/usr/src/lib/libdladm/common/libdlmgmt.c +++ b/usr/src/lib/libdladm/common/libdlmgmt.c @@ -275,7 +275,7 @@ dladm_walk_datalink_id(int (*fn)(dladm_handle_t, datalink_id_t, void *), { dlmgmt_door_getnext_t getnext; dlmgmt_getnext_retval_t retval; - uint32_t dlmgmt_flags; + uint32_t dlmgmt_flags; datalink_id_t linkid = DATALINK_INVALID_LINKID; dladm_status_t status = DLADM_STATUS_OK; size_t sz = sizeof (retval); @@ -514,7 +514,7 @@ dladm_getnext_conf_linkprop(dladm_handle_t handle, dladm_conf_t conf, return (DLADM_STATUS_NOTFOUND); if ((err = nvpair_value_byte_array(nvp, (uchar_t **)&oattrval, - &oattrsz)) != NULL) { + &oattrsz)) != 0) { return (dladm_errno2status(err)); } diff --git a/usr/src/lib/libdladm/common/libdlwlan.c b/usr/src/lib/libdladm/common/libdlwlan.c index 0593ae3cfc..59e1261dd2 100644 --- a/usr/src/lib/libdladm/common/libdlwlan.c +++ b/usr/src/lib/libdladm/common/libdlwlan.c @@ -47,23 +47,23 @@ static dladm_status_t wpa_instance_create(dladm_handle_t, datalink_id_t, void *); static dladm_status_t wpa_instance_delete(dladm_handle_t, datalink_id_t); -static dladm_status_t do_get_bsstype(dladm_handle_t, datalink_id_t, void *, +static dladm_status_t do_get_bsstype(dladm_handle_t, datalink_id_t, void *, int); -static dladm_status_t do_get_essid(dladm_handle_t, datalink_id_t, void *, +static dladm_status_t do_get_essid(dladm_handle_t, datalink_id_t, void *, int); -static dladm_status_t do_get_bssid(dladm_handle_t, datalink_id_t, void *, +static dladm_status_t do_get_bssid(dladm_handle_t, datalink_id_t, void *, int); -static dladm_status_t do_get_signal(dladm_handle_t, datalink_id_t, void *, +static dladm_status_t do_get_signal(dladm_handle_t, datalink_id_t, void *, int); -static dladm_status_t do_get_encryption(dladm_handle_t, datalink_id_t, void *, +static dladm_status_t do_get_encryption(dladm_handle_t, datalink_id_t, void *, int); -static dladm_status_t do_get_authmode(dladm_handle_t, datalink_id_t, void *, +static dladm_status_t do_get_authmode(dladm_handle_t, datalink_id_t, void *, int); -static dladm_status_t do_get_linkstatus(dladm_handle_t, datalink_id_t, void *, +static dladm_status_t do_get_linkstatus(dladm_handle_t, datalink_id_t, void *, int); static dladm_status_t do_get_esslist(dladm_handle_t, datalink_id_t, void *, int); -static dladm_status_t do_get_rate(dladm_handle_t, datalink_id_t, void *, int); +static dladm_status_t do_get_rate(dladm_handle_t, datalink_id_t, void *, int); static dladm_status_t do_get_mode(dladm_handle_t, datalink_id_t, void *, int); static dladm_status_t do_get_capability(dladm_handle_t, datalink_id_t, void *, int); @@ -104,13 +104,13 @@ static val_desc_t linkstatus_vals[] = { { "connected", DLADM_WLAN_LINK_CONNECTED } }; -static val_desc_t secmode_vals[] = { +static val_desc_t secmode_vals[] = { { "none", DLADM_WLAN_SECMODE_NONE }, { "wep", DLADM_WLAN_SECMODE_WEP }, { "wpa", DLADM_WLAN_SECMODE_WPA } }; -static val_desc_t strength_vals[] = { +static val_desc_t strength_vals[] = { { "very weak", DLADM_WLAN_STRENGTH_VERY_WEAK }, { "weak", DLADM_WLAN_STRENGTH_WEAK }, { "good", DLADM_WLAN_STRENGTH_GOOD }, @@ -263,7 +263,7 @@ dladm_wlan_scan(dladm_handle_t handle, datalink_id_t linkid, void *arg, uint32_t count; wl_ess_conf_t *wlp; wl_ess_list_t *wls = NULL; - char buf[WLDP_BUFSIZE]; + char buf[WLDP_BUFSIZE]; wl_linkstatus_t wl_status; dladm_wlan_attr_t wlattr; dladm_status_t status; @@ -558,8 +558,8 @@ dladm_wlan_connect(dladm_handle_t handle, datalink_id_t linkid, uint_t flags) { int i; - char buf[WLDP_BUFSIZE]; - connect_state_t state = {0, NULL, NULL}; + char buf[WLDP_BUFSIZE]; + connect_state_t state = {0, 0, NULL}; attr_node_t *nodep = NULL; boolean_t create_ibss, set_authmode; dladm_wlan_attr_t **wl_list = NULL; diff --git a/usr/src/lib/libdladm/common/linkprop.c b/usr/src/lib/libdladm/common/linkprop.c index 0684971453..c33268c8f8 100644 --- a/usr/src/lib/libdladm/common/linkprop.c +++ b/usr/src/lib/libdladm/common/linkprop.c @@ -71,7 +71,7 @@ /* * The linkprop get() callback. - * - pd: pointer to the prop_desc_t + * - pd: pointer to the prop_desc_t * - propstrp: a property string array to keep the returned property. * Caller allocated. * - cntp: number of returned properties. @@ -88,7 +88,7 @@ typedef dladm_status_t pd_getf_t(dladm_handle_t, prop_desc_t *pdp, * The linkprop set() callback. * - propval: a val_desc_t array which keeps the property values to be set. * - cnt: number of properties to be set. - * - flags: additional flags passed down the system call. + * - flags: additional flags passed down the system call. * * pd_set takes val_desc_t given by pd_check(), translates it into * a format suitable for kernel consumption. This may require allocation @@ -416,8 +416,8 @@ static const bridge_public_prop_t bridge_prop[] = { }; static val_desc_t link_duplex_vals[] = { - { "half", LINK_DUPLEX_HALF }, - { "full", LINK_DUPLEX_HALF } + { "half", LINK_DUPLEX_HALF }, + { "full", LINK_DUPLEX_HALF } }; static val_desc_t link_status_vals[] = { { "up", LINK_STATE_UP }, @@ -2659,7 +2659,7 @@ check_allowedips(dladm_handle_t handle, prop_desc_t *pdp, fail: for (i = 0; i < val_cnt; i++) { free((void *)vdp[i].vd_val); - vdp[i].vd_val = NULL; + vdp[i].vd_val = 0; } return (status); } @@ -2997,7 +2997,7 @@ check_allowedcids(dladm_handle_t handle, prop_desc_t *pdp, fail: for (i = 0; i < val_cnt; i++) { free((void *)vdp[i].vd_val); - vdp[i].vd_val = NULL; + vdp[i].vd_val = 0; } return (status); } @@ -3065,7 +3065,7 @@ check_secondary_macs(dladm_handle_t handle, prop_desc_t *pdp, fail: for (i = 0; i < val_cnt; i++) { free((void *)vdp[i].vd_val); - vdp[i].vd_val = NULL; + vdp[i].vd_val = 0; } return (status); } @@ -3364,7 +3364,7 @@ check_rate(dladm_handle_t handle, prop_desc_t *pdp, datalink_id_t linkid, uint_t modval_cnt = MAX_SUPPORT_RATES; char *buf, **modval; dladm_status_t status; - uint_t perm_flags; + uint_t perm_flags; uint_t val_cnt = *val_cntp; val_desc_t *vdp = *vdpp; @@ -4165,9 +4165,9 @@ i_dladm_set_private_prop(dladm_handle_t handle, datalink_id_t linkid, const char *prop_name, char **prop_val, uint_t val_cnt, uint_t flags) { int i, slen; - int bufsize = 0; + int bufsize = 0; dld_ioc_macprop_t *dip = NULL; - uchar_t *dp; + uchar_t *dp; link_attr_t *p; dladm_status_t status = DLADM_STATUS_OK; |