Author: pjd
Date: Tue Sep 30 12:00:50 2014
New Revision: 272298
URL: http://svnweb.freebsd.org/changeset/base/272298

Log:
  Be prepared that set_dumper() might fail even when resetting it or prefix
  the call with (void) to document that we intentionally ignore the return
  value - no way to handle an error in case of device disappearing.

Modified:
  head/sys/geom/geom_dev.c

Modified: head/sys/geom/geom_dev.c
==============================================================================
--- head/sys/geom/geom_dev.c    Tue Sep 30 11:51:32 2014        (r272297)
+++ head/sys/geom/geom_dev.c    Tue Sep 30 12:00:50 2014        (r272298)
@@ -396,8 +396,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd
                break;
        case DIOCSKERNELDUMP:
                if (*(u_int *)data != 0) {
-                       set_dumper(NULL, NULL);
-                       error = 0;
+                       error = set_dumper(NULL, NULL);
                        break;
                }
                kd.offset = 0;
@@ -616,7 +615,7 @@ g_dev_orphan(struct g_consumer *cp)
 
        /* Reset any dump-area set on this device */
        if (dev->si_flags & SI_DUMPDEV)
-               set_dumper(NULL, NULL);
+               (void)set_dumper(NULL, NULL);
 
        /* Destroy the struct cdev *so we get no more requests */
        destroy_dev_sched_cb(dev, g_dev_callback, cp);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to