linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	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 14:41:08 +0100	[thread overview]
Message-ID: <201011121441.08298.oneukum@suse.de> (raw)
In-Reply-To: <1289530116.20782.2.camel@mola>

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.

	Regards
		Oliver

  parent reply	other threads:[~2010-11-12 13:40 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 [this message]
2010-11-12 17:33   ` Dmitry Torokhov

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=201011121441.08298.oneukum@suse.de \
    --to=oneukum@suse.de \
    --cc=axel.lin@gmail.com \
    --cc=chf.fritz@googlemail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfr@bmx-chemnitz.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).