]> git.baikalelectronics.ru Git - kernel.git/commit
usb: wusbcore: allow wa_xfer_destroy to clean up partially constructed xfers
authorThomas Pugliese <thomas.pugliese@gmail.com>
Thu, 26 Sep 2013 19:08:13 +0000 (14:08 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Sep 2013 23:31:36 +0000 (16:31 -0700)
commitf2dcc9e760387b34fc52d8c890e1fbceab086f65
tree55a43edb203b2c0695454b854ed03e989ff4f42d
parent417430facf7095c774712fe5d4ddc8b06a37a5cd
usb: wusbcore: allow wa_xfer_destroy to clean up partially constructed xfers

If __wa_xfer_setup fails, it can leave a partially constructed wa_xfer
object.  The error handling code eventually calls wa_xfer_destroy which
does not check for NULL before dereferencing xfer->seg which could cause
a kernel panic.  This change also makes sure to free xfer->seg which was
being leaked for all transfers before this change.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/wusbcore/wa-xfer.c