mceusb: fix memory leaks in error path
authorJohan Hovold <johan@kernel.org>
Thu, 1 Jun 2017 07:45:59 +0000 (04:45 -0300)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 12 Oct 2017 14:27:09 +0000 (15:27 +0100)
commit34760dbbcc560d38fdb1c1e57572a965c2f8aca5
treefd4bd479537f1d3be33ac3b2474e18884dd2ce68
parent5d3c2a5fa40cdfc1d969f2b7f127dd75837476b8
mceusb: fix memory leaks in error path

commit 2d5a6ce71c72d98d4f7948672842e3e8c265a8b7 upstream.

Fix urb and transfer-buffer leaks in an urb-submission error path which
may be hit when a device is disconnected.

Fixes: 66e89522aff7 ("V4L/DVB: IR: add mceusb IR receiver driver")

Cc: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
[bwh: Backported to 3.2:
 - Add check on urb_type, as async_buf and async_urb aren't always allocated
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/media/rc/mceusb.c