<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/bluetooth/btwilink.c, branch linux-4.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.16.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2017-07-22T06:39:39Z</updated>
<entry>
<title>Bluetooth: Style fix - align block comments</title>
<updated>2017-07-22T06:39:39Z</updated>
<author>
<name>Derek Robson</name>
<email>robsonde@gmail.com</email>
</author>
<published>2017-07-22T01:47:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d98422cb6619408f1779457fefc5da983fc6bc3b'/>
<id>urn:sha1:d98422cb6619408f1779457fefc5da983fc6bc3b</id>
<content type='text'>
Fixed alignment of all block comments.
Found using checkpatch

Signed-off-by: Derek Robson &lt;robsonde@gmail.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: btwilink: remove unnecessary static in bt_ti_probe()</title>
<updated>2017-07-20T09:18:45Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2017-07-19T22:49:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1d609dd32cd209f4643c7fd450f19d114cec0de7'/>
<id>urn:sha1:1d609dd32cd209f4643c7fd450f19d114cec0de7</id>
<content type='text'>
Remove unnecessary static on local variable hst.
Such variable is initialized before being used,
on every execution path throughout the function.
The static has no benefit and, removing it reduces
the object file size.

This issue was detected using Coccinelle and the
following semantic patch:

@bad exists@
position p;
identifier x;
type T;
@@

static T x@p;
...
x = &lt;+...x...+&gt;

@@
identifier x;
expression e;
type T;
position p != bad.p;
@@

-static
 T x@p;
 ... when != x
     when strict
?x = e;

In the following log you can see the difference in the object file size.
This log is the output of the size command, before and after the code
change:

before:
   text    data     bss     dec     hex filename
   4029    2528     128    6685    1a1d drivers/bluetooth/btwilink.o

after:
   text    data     bss     dec     hex filename
   4007    2472      64    6543    198f drivers/bluetooth/btwilink.o

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: btwilink: Fix unexpected skb free</title>
<updated>2017-05-23T14:19:38Z</updated>
<author>
<name>Loic Poulain</name>
<email>loic.poulain@intel.com</email>
</author>
<published>2017-05-23T09:51:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a6187ffdfcc854ce4d97f307e12508a4bde8bcf3'/>
<id>urn:sha1:a6187ffdfcc854ce4d97f307e12508a4bde8bcf3</id>
<content type='text'>
The caller (hci_core) still owns the skb in case of error, releasing
it inside the send function can lead to use-after-free errors.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Loic Poulain &lt;loic.poulain@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: btwilink: Fix probe return value</title>
<updated>2016-10-20T08:14:49Z</updated>
<author>
<name>Jacob Siverskog</name>
<email>jacob@teenage.engineering</email>
</author>
<published>2016-10-20T07:05:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6add49fff9233a5c43011eb42b521257cbaa9bda'/>
<id>urn:sha1:6add49fff9233a5c43011eb42b521257cbaa9bda</id>
<content type='text'>
Probe functions should return 0 on success. This driver's probe
returns the value returned by hci_register_dev(), which is the hci
index. This works for systems with only one hci device (id = 0) but
for systems where the btwilink device ends up with an id larger than
0, things will start to fall apart.

Make the probe function return 0 on success.

Signed-off-by: Jacob Siverskog &lt;jacob@teenage.engineering&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: btwilink: Save the packet type before sending</title>
<updated>2016-09-22T20:18:59Z</updated>
<author>
<name>Laura Abbott</name>
<email>labbott@redhat.com</email>
</author>
<published>2016-09-22T18:20:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=acf91ec384dd4c7c2c88cbaa2e0374e537123c1f'/>
<id>urn:sha1:acf91ec384dd4c7c2c88cbaa2e0374e537123c1f</id>
<content type='text'>
Running with KASAN produces some messages:

BUG: KASAN: use-after-free in ti_st_send_frame+0x9c/0x16c at addr
ffffffc064868fe8
Read of size 1 by task kworker/u17:1/1266

&lt;KASAN output trimmed&gt;

Hardware name: HiKey Development Board (DT)
Workqueue: hci0 hci_cmd_work
Call trace:
[&lt;ffffffc00008c00c&gt;] dump_backtrace+0x0/0x178
[&lt;ffffffc00008c1a4&gt;] show_stack+0x20/0x28
[&lt;ffffffc00067da38&gt;] dump_stack+0xa8/0xe0
[&lt;ffffffc000288430&gt;] print_trailer+0x110/0x174
[&lt;ffffffc00028aedc&gt;] object_err+0x4c/0x5c
[&lt;ffffffc00028f714&gt;] kasan_report_error+0x254/0x54c
[&lt;ffffffc00028fa70&gt;] kasan_report+0x64/0x70
[&lt;ffffffc00028eb8c&gt;] __asan_load1+0x4c/0x54
[&lt;ffffffc000b59b24&gt;] ti_st_send_frame+0x9c/0x16c
[&lt;ffffffc000ee8dcc&gt;] hci_send_frame+0xb4/0x118
[&lt;ffffffc000ee8efc&gt;] hci_cmd_work+0xcc/0x154
[&lt;ffffffc0000f6c48&gt;] process_one_work+0x26c/0x7a4
[&lt;ffffffc0000f721c&gt;] worker_thread+0x9c/0x73c
[&lt;ffffffc000100250&gt;] kthread+0x138/0x154
[&lt;ffffffc000085c50&gt;] ret_from_fork+0x10/0x40

The packet is being accessed for statistics after it has been freed.
Save the packet type before sending for statistics afterwards.

Signed-off-by: Laura Abbott &lt;labbott@redhat.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>drivers: misc: ti-st: Use int instead of fuzzy char for callback status</title>
<updated>2016-07-17T17:59:26Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2016-06-06T09:02:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4360fa22ad5b48a1d1e10e31ffb383ed8c977435'/>
<id>urn:sha1:4360fa22ad5b48a1d1e10e31ffb383ed8c977435</id>
<content type='text'>
On mips and parisc:

    drivers/bluetooth/btwilink.c: In function 'ti_st_open':
    drivers/bluetooth/btwilink.c:174:21: warning: overflow in implicit constant conversion [-Woverflow]
       hst-&gt;reg_status = -EINPROGRESS;

    drivers/nfc/nfcwilink.c: In function 'nfcwilink_open':
    drivers/nfc/nfcwilink.c:396:31: warning: overflow in implicit constant conversion [-Woverflow]
      drv-&gt;st_register_cb_status = -EINPROGRESS;

There are actually two issues:
  1. Whether "char" is signed or unsigned depends on the architecture.
     As the completion callback data is used to pass a (negative) error
     code, it should always be signed.
  2. EINPROGRESS is 150 on mips, 245 on parisc.
     Hence -EINPROGRESS doesn't fit in a signed 8-bit number.

Change the callback status from "char" to "int" to fix these.

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Acked-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
Acked-by: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Use new hci_skb_pkt_* wrappers for drivers</title>
<updated>2015-11-19T16:50:27Z</updated>
<author>
<name>Marcel Holtmann</name>
<email>marcel@holtmann.org</email>
</author>
<published>2015-11-05T06:33:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=618e8bc228cda7b8c517caac40a45ee909b8672d'/>
<id>urn:sha1:618e8bc228cda7b8c517caac40a45ee909b8672d</id>
<content type='text'>
The new hci_skb_pkt_* wrappers are mainly intented for drivers to
require less knowledge about bt_cb(sbk) handling. So after converting
the core packet handling, convert all drivers.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Move handling of HCI_RUNNING flag into core</title>
<updated>2015-10-05T07:30:25Z</updated>
<author>
<name>Marcel Holtmann</name>
<email>marcel@holtmann.org</email>
</author>
<published>2015-10-04T21:34:02Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e9ca8bf157f2b45f8f670517c96da313083ee9b2'/>
<id>urn:sha1:e9ca8bf157f2b45f8f670517c96da313083ee9b2</id>
<content type='text'>
Setting and clearing of HCI_RUNNING flag in each and every driver is
just duplicating the same code all over the place. So instead of having
the driver do it in their hdev-&gt;open and hdev-&gt;close callbacks, set it
globally in the core transport handling.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Move HCI_RUNNING check into hci_send_frame</title>
<updated>2015-10-05T07:30:10Z</updated>
<author>
<name>Marcel Holtmann</name>
<email>marcel@holtmann.org</email>
</author>
<published>2015-10-04T21:34:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=73d0d3c8671190ea982a8e79a7c79fbfe88f8f47'/>
<id>urn:sha1:73d0d3c8671190ea982a8e79a7c79fbfe88f8f47</id>
<content type='text'>
In all callbacks for hdev-&gt;send the status of HCI_RUNNING is checked. So
instead of repeating that code in every driver, move the check into the
hci_send_frame function before calling hdev-&gt;send.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: btwilink: remove DEBUG define</title>
<updated>2015-05-13T21:00:51Z</updated>
<author>
<name>Leo Yan</name>
<email>leo.yan@linaro.org</email>
</author>
<published>2015-05-05T07:09:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4541c561b6abeb52ad5d9428e4a23e037bbe2b49'/>
<id>urn:sha1:4541c561b6abeb52ad5d9428e4a23e037bbe2b49</id>
<content type='text'>
Remove the DEBUG define as the debug code; so can remove mass debug info
from log buffer when using dmesg.

Signed-off-by: Leo Yan &lt;leo.yan@linaro.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
</feed>
