linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Oliver Neukum <oneukum@suse.de>
Cc: Axel Lin <axel.lin@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Marko Friedemann <mfr@bmx-chemnitz.de>,
	Christoph Fritz <chf.fritz@googlemail.com>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH 1/3] Input: xpad - return proper error in error path
Date: Fri, 12 Nov 2010 09:33:43 -0800	[thread overview]
Message-ID: <20101112173343.GC1224@core.coreip.homeip.net> (raw)
In-Reply-To: <201011121441.08298.oneukum@suse.de>

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

      reply	other threads:[~2010-11-12 17:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12  2:48 [PATCH 1/3] Input: xpad - return proper error in error path Axel Lin
2010-11-12  2:49 ` [PATCH 2/3] Input: xpad - fix a memory leak Axel Lin
2010-11-12  2:51 ` [PATCH 3/3] Input: xpad - fix resource reclaim in xpad_probe error path Axel Lin
2010-11-12  6:06 ` [PATCH 1/3] Input: xpad - return proper error in " Dmitry Torokhov
2010-11-12 13:41 ` Oliver Neukum
2010-11-12 17:33   ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101112173343.GC1224@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=axel.lin@gmail.com \
    --cc=chf.fritz@googlemail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfr@bmx-chemnitz.de \
    --cc=oneukum@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).