fixed up postconfig() error handling
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 14 Feb 2001 02:36:56 +0000 (02:36 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 14 Feb 2001 02:36:56 +0000 (02:36 +0000)
comedi/drivers.c

index 2e3da1305df974a64e5132c66559385b7c7a8f48..952ec0355c4c6c42c8cd4983ccfea7204e0c58c8 100644 (file)
@@ -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);