<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/nfc/pn533, branch linux-5.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-05-18T12:58:13Z</updated>
<entry>
<title>nfc: pn533: Fix buggy cleanup order</title>
<updated>2022-05-18T12:58:13Z</updated>
<author>
<name>Lin Ma</name>
</author>
<published>2022-05-18T10:53:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b8cedb7093b2d1394cae9b86494cba4b62d3a30a'/>
<id>urn:sha1:b8cedb7093b2d1394cae9b86494cba4b62d3a30a</id>
<content type='text'>
When removing the pn533 device (i2c or USB), there is a logic error. The
original code first cancels the worker (flush_delayed_work) and then
destroys the workqueue (destroy_workqueue), leaving the timer the last
one to be deleted (del_timer). This result in a possible race condition
in a multi-core preempt-able kernel. That is, if the cleanup
(pn53x_common_clean) is concurrently run with the timer handler
(pn533_listen_mode_timer), the timer can queue the poll_work to the
already destroyed workqueue, causing use-after-free.

This patch reorder the cleanup: it uses the del_timer_sync to make sure
the handler is finished before the routine will destroy the workqueue.
Note that the timer cannot be activated by the worker again.

static void pn533_wq_poll(struct work_struct *work)
...
 rc = pn533_send_poll_frame(dev);
 if (rc)
   return;

 if (cur_mod-&gt;len == 0 &amp;&amp; dev-&gt;poll_mod_count &gt; 1)
   mod_timer(&amp;dev-&gt;listen_timer, ...);

That is, the mod_timer can be called only when pn533_send_poll_frame()
returns no error, which is impossible because the device is detaching
and the lower driver should return ENODEV code.

Signed-off-by: Lin Ma &lt;linma@zju.edu.cn&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>nfc: pn533: Fix double free when pn533_fill_fragment_skbs() fails</title>
<updated>2021-11-07T19:37:04Z</updated>
<author>
<name>Chengfeng Ye</name>
</author>
<published>2021-11-05T13:36:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9fec40f850658e00a14a7dd9e06f7fbc7e59cc4a'/>
<id>urn:sha1:9fec40f850658e00a14a7dd9e06f7fbc7e59cc4a</id>
<content type='text'>
skb is already freed by dev_kfree_skb in pn533_fill_fragment_skbs,
but follow error handler branch when pn533_fill_fragment_skbs()
fails, skb is freed again, results in double free issue. Fix this
by not free skb in error path of pn533_fill_fragment_skbs.

Fixes: 963a82e07d4e ("NFC: pn533: Split large Tx frames in chunks")
Fixes: 93ad42020c2d ("NFC: pn533: Target mode Tx fragmentation support")
Signed-off-by: Chengfeng Ye &lt;cyeaa@connect.ust.hk&gt;
Reviewed-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>nfc: pn533: Constify pn533_phy_ops</title>
<updated>2021-10-07T12:35:10Z</updated>
<author>
<name>Rikard Falkeborn</name>
</author>
<published>2021-10-06T22:47:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bc642817b6d9e058e058a0bba4bb35df19eb2911'/>
<id>urn:sha1:bc642817b6d9e058e058a0bba4bb35df19eb2911</id>
<content type='text'>
Neither the driver or the core modifies the pn533_phy_ops struct, so
make them const to allow the compiler to put the static structs in
read-only memory.

Signed-off-by: Rikard Falkeborn &lt;rikard.falkeborn@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>nfc: pn533: Constify serdev_device_ops</title>
<updated>2021-10-07T12:35:10Z</updated>
<author>
<name>Rikard Falkeborn</name>
</author>
<published>2021-10-06T22:47:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be5f60d8b6f9611ff3a687de5d47d3ed9fb2cfb0'/>
<id>urn:sha1:be5f60d8b6f9611ff3a687de5d47d3ed9fb2cfb0</id>
<content type='text'>
The only usage of pn532_serdev_ops is to pass its address to
serdev_device_set_client_ops(), which takes a pointer to const
serdev_device_ops as argument. Make it const to allow the compiler to
put it in read-only memory.

Signed-off-by: Rikard Falkeborn &lt;rikard.falkeborn@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>nfc: pn533: use dev_err() instead of pr_err()</title>
<updated>2021-09-13T13:38:00Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2021-09-13T13:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9981ab2151226d5be03b220142e383a1bd91daf2'/>
<id>urn:sha1:9981ab2151226d5be03b220142e383a1bd91daf2</id>
<content type='text'>
Print error message with reference to a device.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>nfc: pn533: drop unneeded debug prints</title>
<updated>2021-09-13T13:38:00Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2021-09-13T13:20:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b7b96587c18b709a7ebea73c8d140dfed81ab1cb'/>
<id>urn:sha1:b7b96587c18b709a7ebea73c8d140dfed81ab1cb</id>
<content type='text'>
ftrace is a preferred and standard way to debug entering and exiting
functions so drop useless debug prints.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>nfc: constify nfc_ops</title>
<updated>2021-07-25T08:21:21Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2021-07-24T21:49:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f6c802a726aea43a2937763f13560c1fd170fae6'/>
<id>urn:sha1:f6c802a726aea43a2937763f13560c1fd170fae6</id>
<content type='text'>
Neither the core nor the drivers modify the passed pointer to struct
nfc_ops, so make it a pointer to const for correctness and safety.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>nfc: pn533: drop unneeded braces {} in if</title>
<updated>2021-06-01T04:32:37Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2021-05-31T07:38:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=feab6ba21da73a86ed406fe2c7d075147f73eb44'/>
<id>urn:sha1:feab6ba21da73a86ed406fe2c7d075147f73eb44</id>
<content type='text'>
{} braces are not needed over single if-statement.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Link: https://lore.kernel.org/r/20210531073902.7111-3-krzysztof.kozlowski@canonical.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfc: pn533: drop ftrace-like debugging messages</title>
<updated>2021-06-01T04:32:37Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2021-05-31T07:38:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=62f64417afd6babfa3a45800c11b5a8fce447c71'/>
<id>urn:sha1:62f64417afd6babfa3a45800c11b5a8fce447c71</id>
<content type='text'>
Now that the kernel has ftrace, any debugging calls that just do "made
it to this function!" and "leaving this function!" can be removed.
Better to use standard debugging tools.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Link: https://lore.kernel.org/r/20210531073902.7111-2-krzysztof.kozlowski@canonical.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfc: pn533: mark OF device ID tables as maybe unused</title>
<updated>2021-05-28T22:05:55Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2021-05-28T12:41:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b3a790d4374981732202fd13d6634c439bad9cfe'/>
<id>urn:sha1:b3a790d4374981732202fd13d6634c439bad9cfe</id>
<content type='text'>
The driver can match either via OF or I2C ID tables.  If OF is disabled,
the table will be unused:

    drivers/nfc/pn533/i2c.c:252:34: warning:
        ‘of_pn533_i2c_match’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Link: https://lore.kernel.org/r/20210528124200.79655-7-krzysztof.kozlowski@canonical.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
