From 7af1e31761f34e698cdf576e46c042b327f5a612 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 31 Mar 2005 12:19:44 +0000 Subject: Explicitly hold a reference to the cdev we have just cloned. This closes the race where the cdev was reclaimed before it ever made it back to devfs lookup. --- sys/cam/scsi/scsi_target.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/cam/scsi') diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index 6b07425..b60c805 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -1035,6 +1035,7 @@ targclone(void *arg, char *name, int namelen, struct cdev **dev) return; *dev = make_dev(&targ_cdevsw, unit2minor(u), UID_ROOT, GID_WHEEL, 0600, "targ%d", u); + dev_ref(*dev); (*dev)->si_flags |= SI_CHEAPCLONE; } -- cgit v1.1