Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Ignore return values when restoring what has just be...



details:   https://anonhg.NetBSD.org/src/rev/4b87be87135b
branches:  trunk
changeset: 816994:4b87be87135b
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Aug 05 08:24:46 2016 +0000

description:
Ignore return values when restoring what has just been undone.  We're
really just putting back something that was there before, so we should
not get any errors, and a panic() would be rather severe.

This and the corresponding commit to vnd.c address newly reported
Coverity CID 1364761 and CID 1364760

diffstat:

 sys/dev/cgd.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 8163d792ca17 -r 4b87be87135b sys/dev/cgd.c
--- a/sys/dev/cgd.c     Fri Aug 05 08:21:24 2016 +0000
+++ b/sys/dev/cgd.c     Fri Aug 05 08:24:46 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.109 2016/07/25 12:45:13 pgoyette Exp $ */
+/* $NetBSD: cgd.c,v 1.110 2016/08/05 08:24:46 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.109 2016/07/25 12:45:13 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.110 2016/08/05 08:24:46 pgoyette Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1082,7 +1082,7 @@
                 */
                error = config_cfattach_detach(cgd_cd.cd_name, &cgd_ca);
                if (error) {
-                       error = devsw_attach("cgd", &cgd_bdevsw, &cgd_bmajor,
+                       (void)devsw_attach("cgd", &cgd_bdevsw, &cgd_bmajor,
                            &cgd_cdevsw, &cgd_cmajor);
                        aprint_error("%s: failed to detach %s cfattach, "
                            "error %d\n", __func__, cgd_cd.cd_name, error);
@@ -1090,8 +1090,8 @@
                }
                error = config_cfdriver_detach(&cgd_cd);
                if (error) {
-                       config_cfattach_attach(cgd_cd.cd_name, &cgd_ca);
-                       devsw_attach("cgd", &cgd_bdevsw, &cgd_bmajor,
+                       (void)config_cfattach_attach(cgd_cd.cd_name, &cgd_ca);
+                       (void)devsw_attach("cgd", &cgd_bdevsw, &cgd_bmajor,
                            &cgd_cdevsw, &cgd_cmajor);
                        aprint_error("%s: failed to detach %s cfdriver, "
                            "error %d\n", __func__, cgd_cd.cd_name, error);



Home | Main Index | Thread Index | Old Index