USB: serial: io_edgeport: fix memory leaks in probe error path
authorJohan Hovold <johan@kernel.org>
Sun, 8 May 2016 18:07:57 +0000 (20:07 +0200)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 6 Jun 2016 23:11:00 +0000 (19:11 -0400)
commit4ee0d8f0693bac01326a4f808d56b7d2c5a328e1
tree8261df1f8f8eee54e7919f3529c2c8aa985243a9
parentcaccc240d4d6d9e1ebe998361ce1f2d1520cf2fc
USB: serial: io_edgeport: fix memory leaks in probe error path

[ Upstream commit c8d62957d450cc1a22ce3242908709fe367ddc8e ]

URBs and buffers allocated in attach for Epic devices would never be
deallocated in case of a later probe error (e.g. failure to allocate
minor numbers) as disconnect is then never called.

Fix by moving deallocation to release and making sure that the
URBs are first unlinked.

Fixes: f9c99bb8b3a1 ("USB: usb-serial: replace shutdown with disconnect,
release")
Cc: stable <stable@vger.kernel.org> # v2.6.31
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/usb/serial/io_edgeport.c