Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-localcount]: src/sys/dev Clean up the vnd_spawn() routine so it...
details: https://anonhg.NetBSD.org/src/rev/cadf6a4564f1
branches: pgoyette-localcount
changeset: 852876:cadf6a4564f1
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu Jul 28 01:07:20 2016 +0000
description:
Clean up the vnd_spawn() routine so it actually works. In particular,
it needs to return the new unit's sc _after_ acquiring a reference to
the unit.
diffstat:
sys/dev/vnd.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diffs (33 lines):
diff -r b0e2b47b8e19 -r cadf6a4564f1 sys/dev/vnd.c
--- a/sys/dev/vnd.c Wed Jul 27 23:17:31 2016 +0000
+++ b/sys/dev/vnd.c Thu Jul 28 01:07:20 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vnd.c,v 1.256.2.10 2016/07/27 23:17:31 pgoyette Exp $ */
+/* $NetBSD: vnd.c,v 1.256.2.11 2016/07/28 01:07:20 pgoyette Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.256.2.10 2016/07/27 23:17:31 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.256.2.11 2016/07/28 01:07:20 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vnd.h"
@@ -311,12 +311,10 @@
cf->cf_unit = unit;
cf->cf_fstate = FSTATE_STAR;
+ /* Attach a new unit */
self = config_attach_pseudo(cf);
- return device_private(config_attach_pseudo(cf));
- if (config_attach_pseudo(cf) == NULL)
- return NULL;
-
+ /* And acquire a reference to it */
self = device_lookup_acquire(&vnd_cd, unit);
if (self == NULL)
return NULL;
Home |
Main Index |
Thread Index |
Old Index