All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Adam Lee <adam8157@gmail.com>
Cc: linux-bluetooth@vger.kernel.org,
	Marcel Holtmann <marcel@holtmann.org>,
	Wen-chien Jesse Sung <jesse.sung@canonical.com>,
	AceLan Kao <acelan.kao@canonical.com>,
	Tedd Ho-Jeong An <tedd.an@intel.com>,
	Anthony Wong <anthony.wong@canonical.com>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] btusb: fix wrong use of PTR_ERR()
Date: Wed, 10 Jul 2013 11:28:03 +0100	[thread overview]
Message-ID: <20130710102803.GA2952@joana> (raw)
In-Reply-To: <20130710020212.GA16015@adam-laptop>

Hi Adam,

* Adam Lee <adam8157@gmail.com> [2013-07-10 10:02:12 +0800]:

> PTR_ERR() returns a signed long type value which is limited by IS_ERR(),
> it must be a negative number whose range is [-MAX_ERRNO, 0).
> 
> The bug here returns negative numbers as error codes, then check it by
> "if (ret < 0)", but -PTR_ERR() is actually positive. The wrong use here
> leads to failure as below, even panic.
> 
> [   12.958920] Bluetooth: hci0 command 0xfc8e tx timeout
> [   14.961765] Bluetooth: hci0 command 0xfc8e tx timeout
> [   16.964688] Bluetooth: hci0 command 0xfc8e tx timeout
> [   20.954501] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
> [   22.957358] Bluetooth: hci0 command 0xfc8e tx timeout
> [   30.948922] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
> [   32.951780] Bluetooth: hci0 command 0xfc8e tx timeout
> [   40.943359] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
> [   42.946219] Bluetooth: hci0 command 0xfc8e tx timeout
> [   50.937812] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
> [   52.940670] Bluetooth: hci0 command 0xfc8e tx timeout
> [   60.932236] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
> [   62.935092] Bluetooth: hci0 command 0xfc8e tx timeout
> [   70.926688] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
> [   72.929545] Bluetooth: hci0 command 0xfc8e tx timeout
> [   80.921111] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-110)
> [   82.923969] Bluetooth: hci0 command 0xfc2f tx timeout
> [   90.915542] Bluetooth: hci0 sending Intel patch command (0xfc2f) failed (-110)
> [   92.918406] Bluetooth: hci0 command 0xfc11 tx timeout
> [  100.909955] Bluetooth: hci0 sending Intel patch command (0xfc11) failed (-110)
> [  102.912858] Bluetooth: hci0 command 0xfc60 tx timeout
> [  110.904394] Bluetooth: hci0 sending Intel patch command (0xfc60) failed (-110)
> [  112.907293] Bluetooth: hci0 command 0xfc11 tx timeout
> [  120.898831] Bluetooth: hci0 exiting Intel manufacturer mode failed (-110)
> [  120.904757] bluetoothd[1030]: segfault at 4 ip 00007f8b2eb55236 sp 00007fff53ff6920 error 4 in bluetoothd[7f8b2eaff000+cb000]
> 
> Signed-off-by: Adam Lee <adam.lee@canonical.com>
> ---
>  drivers/bluetooth/btusb.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)

Patch has been applied to bluetooth.git. Thanks.

	Gustavo

      reply	other threads:[~2013-07-10 10:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04 12:43 [PATCH] btusb: fix overflow return values Adam Lee
2013-07-05  2:37 ` Yang Bai
2013-07-05  2:53   ` Yang Bai
2013-07-05  2:53     ` Yang Bai
2013-07-05  2:59   ` Adam Lee
2013-07-05  4:41     ` Adam Lee
2013-07-08 18:50 ` Marcel Holtmann
2013-07-09  2:55   ` Adam Lee
2013-07-09  7:40     ` Adam Lee
2013-07-09  8:48       ` [PATCH v2] btusb: fix wrong use of PTR_ERR() Adam Lee
2013-07-09 15:32     ` [PATCH] btusb: fix overflow return values Gustavo Padovan
2013-07-10  2:02       ` [PATCH v3] btusb: fix wrong use of PTR_ERR() Adam Lee
2013-07-10 10:28         ` Gustavo Padovan [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=20130710102803.GA2952@joana \
    --to=gustavo@padovan.org \
    --cc=acelan.kao@canonical.com \
    --cc=adam8157@gmail.com \
    --cc=anthony.wong@canonical.com \
    --cc=jesse.sung@canonical.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=tedd.an@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.