From linux-usb-devel-bounces@lists.sourceforge.net Fri Oct 26 18:36:57 2007 From: Roel Kluin <12o3l@tiscali.nl> Date: Sat, 27 Oct 2007 03:36:37 +0200 Subject: USB: free memory when writing fails in usb/serial/mos7840.c To: linux-usb-devel@lists.sourceforge.net Message-ID: <47229625.5090109@tiscali.nl> Free buffer when writing ZLP_REG5 failed Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/mos7840.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -2711,7 +2711,7 @@ static int mos7840_startup(struct usb_se status = mos7840_set_reg_sync(serial->port[0], ZLP_REG5, Data); if (status < 0) { dbg("Writing ZLP_REG5 failed status-0x%x\n", status); - return -1; + goto error; } else dbg("ZLP_REG5 Writing success status%d\n", status);