summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-12-06 10:32:32 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-12-06 10:32:32 +0000
commitde7cfd6ba2a9af7406a624b96f01681169f25979 (patch)
tree970ba2aa273f42c42317a18db7ddd43014afa1af /driver
parent8df3435738ecf4f3ade50fad8a9730e90e20a8c0 (diff)
Remove the input driver before returning NULL on error in PreInit().
Diffstat (limited to 'driver')
-rw-r--r--driver/xf86-input-ws/src/ws.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/driver/xf86-input-ws/src/ws.c b/driver/xf86-input-ws/src/ws.c
index 830c938ed..f9231ac96 100644
--- a/driver/xf86-input-ws/src/ws.c
+++ b/driver/xf86-input-ws/src/ws.c
@@ -13,7 +13,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $OpenBSD: ws.c,v 1.26 2009/11/26 18:18:34 matthieu Exp $ */
+/* $OpenBSD: ws.c,v 1.27 2009/12/06 10:32:31 matthieu Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -336,10 +336,13 @@ wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
pInfo->flags |= XI86_CONFIGURED;
return pInfo;
fail:
- if (priv != NULL)
+ if (priv != NULL) {
xfree(priv);
- if (pInfo != NULL)
- xfree(pInfo);
+ pInfo->private = NULL;
+ }
+ if (pInfo != NULL) {
+ xf86DeleteInput(pInfo, 0);
+ }
return NULL;
}