<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/net/wan/farsync.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2022-12-12T09:42:45Z</updated>
<entry>
<title>net: farsync: Fix kmemleak when rmmods farsync</title>
<updated>2022-12-12T09:42:45Z</updated>
<author>
<name>Li Zetao</name>
<email>lizetao1@huawei.com</email>
</author>
<published>2022-12-08T12:05:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2f623aaf9f31de968dea6169849706a2f9be444c'/>
<id>urn:sha1:2f623aaf9f31de968dea6169849706a2f9be444c</id>
<content type='text'>
There are two memory leaks reported by kmemleak:

  unreferenced object 0xffff888114b20200 (size 128):
    comm "modprobe", pid 4846, jiffies 4295146524 (age 401.345s)
    hex dump (first 32 bytes):
      e0 62 57 09 81 88 ff ff e0 62 57 09 81 88 ff ff  .bW......bW.....
      01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    backtrace:
      [&lt;ffffffff815bcd82&gt;] kmalloc_trace+0x22/0x60
      [&lt;ffffffff83d35c78&gt;] __hw_addr_add_ex+0x198/0x6c0
      [&lt;ffffffff83d3989d&gt;] dev_addr_init+0x13d/0x230
      [&lt;ffffffff83d1063d&gt;] alloc_netdev_mqs+0x10d/0xe50
      [&lt;ffffffff82b4a06e&gt;] alloc_hdlcdev+0x2e/0x80
      [&lt;ffffffffa016a741&gt;] fst_add_one+0x601/0x10e0 [farsync]
      ...

  unreferenced object 0xffff88810b85b000 (size 1024):
    comm "modprobe", pid 4846, jiffies 4295146523 (age 401.346s)
    hex dump (first 32 bytes):
      00 00 b0 02 00 c9 ff ff 00 70 0a 00 00 c9 ff ff  .........p......
      00 00 00 f2 00 00 00 f3 0a 00 00 00 02 00 00 00  ................
    backtrace:
      [&lt;ffffffff815bcd82&gt;] kmalloc_trace+0x22/0x60
      [&lt;ffffffffa016a294&gt;] fst_add_one+0x154/0x10e0 [farsync]
      [&lt;ffffffff82060e83&gt;] local_pci_probe+0xd3/0x170
      ...

The root cause is traced to the netdev and fst_card_info are not freed
when removes one fst in fst_remove_one(), which may trigger oom if
repeated insmod and rmmod module.

Fix it by adding free_netdev() and kfree() in fst_remove_one(), just as
the operations on the error handling path in fst_add_one().

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Li Zetao &lt;lizetao1@huawei.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: split out ndo_siowandev ioctl</title>
<updated>2021-07-27T19:11:45Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-07-27T13:45:14Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ad7eab2ab014748b062507b7ac69f8e856057717'/>
<id>urn:sha1:ad7eab2ab014748b062507b7ac69f8e856057717</id>
<content type='text'>
In order to further reduce the scope of ndo_do_ioctl(), move
out the SIOCWANDEV handling into a new network device operation
function.

Adjust the prototype to only pass the if_settings sub-structure
in place of the ifreq, and remove the redundant 'cmd' argument
in the process.

Cc: Krzysztof Halasa &lt;khc@pm.waw.pl&gt;
Cc: "Jan \"Yenya\" Kasprzak" &lt;kas@fi.muni.cz&gt;
Cc: Kevin Curtis &lt;kevin.curtis@farsite.co.uk&gt;
Cc: Zhao Qiang &lt;qiang.zhao@nxp.com&gt;
Cc: Martin Schiller &lt;ms@dev.tdt.de&gt;
Cc: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Cc: linux-x25@vger.kernel.org
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>wan: use ndo_siocdevprivate</title>
<updated>2021-07-27T19:11:44Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-07-27T13:45:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=73d74f61a559d8fc2266abfb95085bb7d1917a3e'/>
<id>urn:sha1:73d74f61a559d8fc2266abfb95085bb7d1917a3e</id>
<content type='text'>
The wan drivers each support some custom SIOCDEVPRIVATE
ioctls, plus the common SIOCWANDEV command.

Split these so the ioctl callback only deals with SIOCWANDEV
and the rest is handled by ndo_siocdevprivate.

It might make sense to also split out SIOCWANDEV into a
separate callback in order to eventually remove ndo_do_ioctl
entirely.

Cc: Krzysztof Halasa &lt;khc@pm.waw.pl&gt;
Cc: Kevin Curtis &lt;kevin.curtis@farsite.co.uk&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: farsync: replace comparison to NULL with "fst_card_array[i]"</title>
<updated>2021-06-08T19:04:05Z</updated>
<author>
<name>Peng Li</name>
<email>lipeng321@huawei.com</email>
</author>
<published>2021-06-08T08:12:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f23a3da78a31d2ec7029c9637bf57ec892ada40c'/>
<id>urn:sha1:f23a3da78a31d2ec7029c9637bf57ec892ada40c</id>
<content type='text'>
According to the chackpatch.pl, comparison to NULL could
be written "fst_card_array[i]".

Signed-off-by: Peng Li &lt;lipeng321@huawei.com&gt;
Signed-off-by: Guangbin Huang &lt;huangguangbin2@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: farsync: remove redundant return</title>
<updated>2021-06-08T19:04:05Z</updated>
<author>
<name>Peng Li</name>
<email>lipeng321@huawei.com</email>
</author>
<published>2021-06-08T08:12:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f01f906ffefc71e5d370e7542884820d1318358b'/>
<id>urn:sha1:f01f906ffefc71e5d370e7542884820d1318358b</id>
<content type='text'>
Void function return statements are not generally useful.

Signed-off-by: Peng Li &lt;lipeng321@huawei.com&gt;
Signed-off-by: Guangbin Huang &lt;huangguangbin2@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: farsync: fix the alignment issue</title>
<updated>2021-06-08T19:04:05Z</updated>
<author>
<name>Peng Li</name>
<email>lipeng321@huawei.com</email>
</author>
<published>2021-06-08T08:12:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d2a1054b8b02afdaae8119fdd7bf1171fd2fce2b'/>
<id>urn:sha1:d2a1054b8b02afdaae8119fdd7bf1171fd2fce2b</id>
<content type='text'>
Alignment should match open parenthesis.

Signed-off-by: Peng Li &lt;lipeng321@huawei.com&gt;
Signed-off-by: Guangbin Huang &lt;huangguangbin2@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: farsync: remove redundant parentheses</title>
<updated>2021-06-08T19:04:05Z</updated>
<author>
<name>Peng Li</name>
<email>lipeng321@huawei.com</email>
</author>
<published>2021-06-08T08:12:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ae1be3fad5695fcb5ad1053b4847f89431f7b922'/>
<id>urn:sha1:ae1be3fad5695fcb5ad1053b4847f89431f7b922</id>
<content type='text'>
Unnecessary parentheses around 'port-&gt;hwif == X21'.

Signed-off-by: Peng Li &lt;lipeng321@huawei.com&gt;
Signed-off-by: Guangbin Huang &lt;huangguangbin2@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: farsync: remove redundant spaces</title>
<updated>2021-06-08T19:04:05Z</updated>
<author>
<name>Peng Li</name>
<email>lipeng321@huawei.com</email>
</author>
<published>2021-06-08T08:12:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b64b5aee73580ec223a95d28b359117b52436ff9'/>
<id>urn:sha1:b64b5aee73580ec223a95d28b359117b52436ff9</id>
<content type='text'>
According to the chackpatch.pl,
space prohibited between function name and open parenthesis '(',
no space is necessary after a cast.

Signed-off-by: Peng Li &lt;lipeng321@huawei.com&gt;
Signed-off-by: Guangbin Huang &lt;huangguangbin2@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: farsync: remove redundant braces {}</title>
<updated>2021-06-08T19:04:05Z</updated>
<author>
<name>Peng Li</name>
<email>lipeng321@huawei.com</email>
</author>
<published>2021-06-08T08:12:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=fa8d10b54760c4869e7d3d6b57e4e5a694f0d112'/>
<id>urn:sha1:fa8d10b54760c4869e7d3d6b57e4e5a694f0d112</id>
<content type='text'>
This patch removes redundant braces {}, to fix the
checkpatch.pl warning:
"braces {} are not necessary for single statement blocks".

Signed-off-by: Peng Li &lt;lipeng321@huawei.com&gt;
Signed-off-by: Guangbin Huang &lt;huangguangbin2@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: farsync: add some required spaces</title>
<updated>2021-06-08T19:04:05Z</updated>
<author>
<name>Peng Li</name>
<email>lipeng321@huawei.com</email>
</author>
<published>2021-06-08T08:12:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=37947a9be3d1a5d551e34f56653c5ccf86814cc3'/>
<id>urn:sha1:37947a9be3d1a5d551e34f56653c5ccf86814cc3</id>
<content type='text'>
Add spaces required around that '=' and '*'.

Signed-off-by: Peng Li &lt;lipeng321@huawei.com&gt;
Signed-off-by: Guangbin Huang &lt;huangguangbin2@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
