Module Name:    src
Committed By:   dholland
Date:           Sat May  9 21:31:05 UTC 2015

Modified Files:
        src/sys/dev/bluetooth: bthub.c

Log Message:
Coverity CID 975184: don't ignore pmf_device_register failure.
(XXX: unfortunately all we can do for the moment is print a warning)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/bluetooth/bthub.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/bluetooth/bthub.c
diff -u src/sys/dev/bluetooth/bthub.c:1.20 src/sys/dev/bluetooth/bthub.c:1.21
--- src/sys/dev/bluetooth/bthub.c:1.20	Fri Jul 25 08:10:36 2014
+++ src/sys/dev/bluetooth/bthub.c	Sat May  9 21:31:05 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bthub.c,v 1.20 2014/07/25 08:10:36 dholland Exp $	*/
+/*	$NetBSD: bthub.c,v 1.21 2015/05/09 21:31:05 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bthub.c,v 1.20 2014/07/25 08:10:36 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bthub.c,v 1.21 2015/05/09 21:31:05 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -121,7 +121,15 @@ bthub_attach(device_t parent, device_t s
 
 	aprint_normal("\n");
 
-	pmf_device_register(self, NULL, NULL);
+	if (!pmf_device_register(self, NULL, NULL)) {
+		/*
+		 * XXX this should not be allowed to happen, but
+		 * avoiding it needs a pretty big rearrangement of
+		 * device attachments.
+		 */
+		printf("bthub_attach: pmf_device_register failed -- "
+		       "no power management for you!\n");
+	}
 }
 
 static int

Reply via email to