From: Frank Mori Hess Date: Wed, 14 Feb 2001 02:36:56 +0000 (+0000) Subject: fixed up postconfig() error handling X-Git-Tag: r0_7_57~24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=82026ea8f23c7b34fe75832846d6422bcfb2450d;p=comedi.git fixed up postconfig() error handling --- diff --git a/comedi/drivers.c b/comedi/drivers.c index 2e3da130..952ec035 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -144,7 +144,13 @@ attached: /* do a little post-config cleanup */ ret = postconfig(dev); if(ret < 0) + { + driv->detach(dev); + if(dev->subdevices)kfree(dev->subdevices); + if(dev->private)kfree(dev->private); + return ret; + } init_waitqueue_head(&dev->read_wait); init_waitqueue_head(&dev->write_wait);