Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/bluetooth Coverity CID 975184: don't ignore pmf_devi...



details:   https://anonhg.NetBSD.org/src/rev/9dbb7b3e1402
branches:  trunk
changeset: 808224:9dbb7b3e1402
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sat May 09 21:31:05 2015 +0000

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

diffstat:

 sys/dev/bluetooth/bthub.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 317a69991032 -r 9dbb7b3e1402 sys/dev/bluetooth/bthub.c
--- a/sys/dev/bluetooth/bthub.c Sat May 09 21:22:18 2015 +0000
+++ b/sys/dev/bluetooth/bthub.c Sat May 09 21:31:05 2015 +0000
@@ -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 @@
 
        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



Home | Main Index | Thread Index | Old Index