USB: core: only clean up what we allocated
authorAndrey Konovalov <andreyknvl@google.com>
Mon, 11 Dec 2017 21:48:41 +0000 (22:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Mar 2019 05:13:55 +0000 (14:13 +0900)
commit4a4aed9055e8e8e6e7becf10821d5f2e1c90c3a8
tree79e7de30d3bbd5f928fdc1ee90dbc59fd2f55dca
parentaab86217763b06bcb563cb69dbbff8d598b52a39
USB: core: only clean up what we allocated

commit 32fd87b3bbf5f7a045546401dfe2894dbbf4d8c3 upstream.

When cleaning up the configurations, make sure we only free the number
of configurations and interfaces that we could have allocated.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/config.c