From f2dbfd322ec9cd157a6e2cd8a53569e718a4b0af Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Sun, 2 Jun 2019 14:55:56 +0000 Subject: 11184 Want CPU Temperature Sensors 11185 i86pc chip module should be smatch clean Reviewed by: Hans Rosenfeld Reviewed by: Jordan Hendricks Reviewed by: Patrick Mooney Reviewed by: Toomas Soome Approved by: Garrett D'Amore --- usr/src/cmd/devfsadm/devfsadm.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'usr/src/cmd/devfsadm/devfsadm.c') diff --git a/usr/src/cmd/devfsadm/devfsadm.c b/usr/src/cmd/devfsadm/devfsadm.c index f81d5b5d67..52f4f4c0da 100644 --- a/usr/src/cmd/devfsadm/devfsadm.c +++ b/usr/src/cmd/devfsadm/devfsadm.c @@ -23,6 +23,7 @@ * Copyright 2016 Toomas Soome * Copyright 2016 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2019, Joyent, Inc. */ /* @@ -2073,6 +2074,16 @@ class_ok(char *class) return (DEVFSADM_SUCCESS); } + /* + * Some create tabs operate on multiple classes of devices because the + * kernel doesn't have a good way for a driver to indicate that a + * particular minor's class is different from that of the dev_info_t + * it belongs to. As such, we'll always fail to match those here. + */ + if (class == NULL) { + return (DEVFSADM_FAILURE); + } + for (i = 0; i < num_classes; i++) { if (strcmp(class, classes[i]) == 0) { return (DEVFSADM_SUCCESS); @@ -3717,10 +3728,10 @@ do_inst_sync(char *filename, char *instfilename) * safely, the database is flushed to a temporary file, then moved into place. * * The following files are used during this process: - * /etc/path_to_inst: The path_to_inst file - * /etc/path_to_inst.: Contains data flushed from the kernel - * /etc/path_to_inst.old: The backup file - * /etc/path_to_inst.old.: Temp file for creating backup + * /etc/path_to_inst: The path_to_inst file + * /etc/path_to_inst.: Contains data flushed from the kernel + * /etc/path_to_inst.old: The backup file + * /etc/path_to_inst.old.: Temp file for creating backup * */ static void @@ -7803,7 +7814,7 @@ add_verbose_id(char *mid) * returns DEVFSADM_TRUE if contents is a minor node in /devices. * If mn_root is not NULL, mn_root is set to: * if contents is a /dev node, mn_root = contents - * OR + * OR * if contents is a /devices node, mn_root set to the '/' * following /devices. */ -- cgit v1.2.3