From 86b7d9928532963e87aa4bfcc8d800d0234c8403 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 13 Jan 2001 16:19:31 +0000 Subject: [PATCH] fix reference counting --- comedi/drivers.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/comedi/drivers.c b/comedi/drivers.c index f7ab17ff..f15395c2 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -92,13 +92,18 @@ int comedi_device_attach(comedi_device *dev,comedi_devconfig *it) int ret; int i=0; int minor; + int use_count; if(dev->attached) return -EBUSY; - minor=dev->minor; + minor = dev->minor; + use_count = dev->use_count; memset(dev,0,sizeof(dev)); dev->minor=minor; + dev->use_count = dev->use_count; + dev->read_subdev=-1; + dev->write_subdev=-1; for(driv=comedi_drivers;driv;driv=driv->next){ if(driv->recognize){ -- 2.26.2