summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-24 13:25:19 +0200
committerToomas Soome <tsoome@me.com>2019-07-09 08:39:26 +0300
commita3ab7e857d66d206fcfc56f9a628266bd25a7bd0 (patch)
treeb11492811ba6ef56d9b78ab9b966c993b5c0872b
parent1fbb7a7c3b62c369349ec1774806ed321e4f6119 (diff)
downloadillumos-joyent-a3ab7e857d66d206fcfc56f9a628266bd25a7bd0.tar.gz
11319 devfsadm: NULL pointer errors
Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/devfsadm/cfg_link.c8
-rw-r--r--usr/src/cmd/devfsadm/devfsadm.c10
2 files changed, 9 insertions, 9 deletions
diff --git a/usr/src/cmd/devfsadm/cfg_link.c b/usr/src/cmd/devfsadm/cfg_link.c
index ffdbc6d0af..e7229325ac 100644
--- a/usr/src/cmd/devfsadm/cfg_link.c
+++ b/usr/src/cmd/devfsadm/cfg_link.c
@@ -61,7 +61,7 @@ static int sata_cfg_creat_cb(di_minor_t minor, di_node_t node);
static int sdcard_cfg_creat_cb(di_minor_t minor, di_node_t node);
static di_node_t pci_cfg_chassis_node(di_node_t, di_prom_handle_t);
-static char *pci_cfg_slotname(di_node_t, di_prom_handle_t, minor_t);
+static char *pci_cfg_slotname(di_node_t, di_prom_handle_t, minor_t);
static int pci_cfg_ap_node(minor_t, di_node_t, di_prom_handle_t,
char *, int, int);
static int pci_cfg_iob_name(di_minor_t, di_node_t, di_prom_handle_t,
@@ -69,7 +69,7 @@ static int pci_cfg_iob_name(di_minor_t, di_node_t, di_prom_handle_t,
static minor_t pci_cfg_pcidev(di_node_t, di_prom_handle_t);
static int pci_cfg_ap_path(di_minor_t, di_node_t, di_prom_handle_t,
char *, int, char **);
-static char *pci_cfg_info_data(char *);
+static char *pci_cfg_info_data(char *);
static int pci_cfg_is_ap_path(di_node_t, di_prom_handle_t);
static int pci_cfg_ap_legacy(di_minor_t, di_node_t, di_prom_handle_t,
char *, int);
@@ -87,7 +87,7 @@ static int di_propall_lookup_ints(di_prom_handle_t, int,
dev_t, di_node_t, const char *, int **);
static int di_propall_lookup_strings(di_prom_handle_t, int,
dev_t, di_node_t, const char *, char **);
-static int serid_printable(uint64_t *seridp);
+static int serid_printable(uint64_t *seridp);
static int di_propall_lookup_slot_names(di_prom_handle_t, int,
dev_t, di_node_t, di_slot_name_t **);
@@ -727,7 +727,7 @@ pci_cfg_ap_path(di_minor_t minor, di_node_t node, di_prom_handle_t ph,
bufsz -= len - 1;
/* set chasflag when the leaf node is within an iob */
- if ((curnode == node) != NULL)
+ if (curnode == node)
chasflag = 1;
}
rv = pci_cfg_ap_node(pci_dev, curnode, ph, bufptr, bufsz, 0);
diff --git a/usr/src/cmd/devfsadm/devfsadm.c b/usr/src/cmd/devfsadm/devfsadm.c
index 52f4f4c0da..7cfcd09a81 100644
--- a/usr/src/cmd/devfsadm/devfsadm.c
+++ b/usr/src/cmd/devfsadm/devfsadm.c
@@ -378,7 +378,7 @@ main(int argc, char *argv[])
detachfromtty();
(void) cond_init(&cv, USYNC_THREAD, 0);
(void) mutex_init(&count_lock, USYNC_THREAD, 0);
- if (thr_create(NULL, NULL,
+ if (thr_create(NULL, 0,
(void *(*)(void *))instance_flush_thread,
NULL, THR_DETACHED, NULL) != 0) {
err_print(CANT_CREATE_THREAD, "daemon",
@@ -390,7 +390,7 @@ main(int argc, char *argv[])
/* start the minor_fini_thread */
(void) mutex_init(&minor_fini_mutex, USYNC_THREAD, 0);
(void) cond_init(&minor_fini_cv, USYNC_THREAD, 0);
- if (thr_create(NULL, NULL,
+ if (thr_create(NULL, 0,
(void *(*)(void *))minor_fini_thread,
NULL, THR_DETACHED, NULL)) {
err_print(CANT_CREATE_THREAD, "minor_fini",
@@ -705,7 +705,7 @@ parse_args(int argc, char *argv[])
}
if (bind == TRUE) {
- if ((mc.major == -1) || (mc.drvname[0] == NULL)) {
+ if ((mc.major == -1) || (mc.drvname[0] == '\0')) {
err_print(MAJOR_AND_B_FLAG);
devfsadm_exit(1);
/*NOTREACHED*/
@@ -6354,7 +6354,7 @@ create_selector_list(char *selector)
selector_list_t *selector_list;
/* parse_devfs_spec splits the next field into keyword & value */
- while ((*selector != NULL) && (error == FALSE)) {
+ while ((*selector != '\0') && (error == FALSE)) {
if (parse_selector(&selector, &key, &val) == DEVFSADM_FAILURE) {
error = TRUE;
break;
@@ -7557,7 +7557,7 @@ getnexttoken(char *next, char **nextp, char **tokenpp, char *tchar)
;
if (*cp1 == '=' || *cp1 == ':' || *cp1 == '&' || *cp1 == '|' ||
*cp1 == ';' || *cp1 == '\n' || *cp1 == '\0') {
- *cp = NULL; /* terminate token */
+ *cp = '\0'; /* terminate token */
cp = cp1;
}
}