From 535d645a03d8ae93acf22335de33a3f219501b06 Mon Sep 17 00:00:00 2001 From: miko Date: Thu, 6 Sep 2018 09:48:23 +0000 Subject: [PATCH] execute the same code for failure of assign_all_jacks_automatically() and attach_all_mididevs(). this ensures unbind_all_jacks() and usbd_deactivate() happen for both cases. ok ratchov@ --- sys/dev/usb/umidi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c index 3f20e5f2c08..1b5e60a72cb 100644 --- a/sys/dev/usb/umidi.c +++ b/sys/dev/usb/umidi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umidi.c,v 1.46 2017/12/30 23:08:29 guenther Exp $ */ +/* $OpenBSD: umidi.c,v 1.47 2018/09/06 09:48:23 miko Exp $ */ /* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -205,8 +205,10 @@ umidi_attach(struct device *parent, struct device *self, void *aux) } err = attach_all_mididevs(sc); if (err!=USBD_NORMAL_COMPLETION) { + unbind_all_jacks(sc); free_all_jacks(sc); free_all_endpoints(sc); + goto error; } #ifdef UMIDI_DEBUG -- 2.20.1