usb: cdc-acm: make sure a refcount is taken early enough
authorOliver Neukum <oneukum@suse.com>
Thu, 8 Aug 2019 14:21:19 +0000 (16:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Aug 2019 08:51:49 +0000 (10:51 +0200)
commitfccd6134d5addf2be1407e3250efdc854b5c5d8a
tree56eb8c969df159dbbff0153d9b67a4758826248f
parent741b832658b98463d619fe4c320f8ab11b2ad4ee
usb: cdc-acm: make sure a refcount is taken early enough

commit c52873e5a1ef72f845526d9f6a50704433f9c625 upstream.

destroy() will decrement the refcount on the interface, so that
it needs to be taken so early that it never undercounts.

Fixes: 7fb57a019f94e ("USB: cdc-acm: Fix potential deadlock (lockdep warning)")
Cc: stable <stable@vger.kernel.org>
Reported-and-tested-by: syzbot+1b2449b7b5dc240d107a@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://lore.kernel.org/r/20190808142119.7998-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-acm.c