[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20101112173343.GC1224@core.coreip.homeip.net>
Date: Fri, 12 Nov 2010 09:33:43 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Oliver Neukum <oneukum@...e.de>
Cc: Axel Lin <axel.lin@...il.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Marko Friedemann <mfr@...-chemnitz.de>,
Christoph Fritz <chf.fritz@...glemail.com>,
linux-input@...r.kernel.org
Subject: Re: [PATCH 1/3] Input: xpad - return proper error in error path
On Fri, Nov 12, 2010 at 02:41:08PM +0100, Oliver Neukum wrote:
> Am Freitag, 12. November 2010, 03:48:36 schrieb Axel Lin:
> > In current implementation, xpad_probe return 0 when
> > usb_alloc_urb failed for xpad->bulk_out and kzalloc failed for xpad->bdata.
> >
> > This patch removes the initialization for error variable,
> > assign the error code at the place the error happens instead.
>
> I am afraid you cannot let stand the order of allocations here anyway,
> as xpad->irq_in is currently submitted before xpad->bulk_out is allocated.
> That however is a race, because the callback for irq_in can call
> xpad360w_process_packet(), which will in turn submit the bulk URB.
>
> I am afraid your patch is pointless unless the logic is also fixed.
I do not think it is fair to call the patch pointless. It does fix the
resource leak and can be a basis for further rework.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists