<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/net/ethernet/microchip, branch v6.6</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>net: lan743x: also select PHYLIB</title>
<updated>2023-10-05T16:10:18+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2023-10-02T19:35:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=566aeed6871ac2189b5bfe03e1a5b3b7be5eca38'/>
<id>566aeed6871ac2189b5bfe03e1a5b3b7be5eca38</id>
<content type='text'>
Since FIXED_PHY depends on PHYLIB, PHYLIB needs to be set to avoid
a kconfig warning:

WARNING: unmet direct dependencies detected for FIXED_PHY
  Depends on [n]: NETDEVICES [=y] &amp;&amp; PHYLIB [=n]
  Selected by [y]:
  - LAN743X [=y] &amp;&amp; NETDEVICES [=y] &amp;&amp; ETHERNET [=y] &amp;&amp; NET_VENDOR_MICROCHIP [=y] &amp;&amp; PCI [=y] &amp;&amp; PTP_1588_CLOCK_OPTIONAL [=y]

Fixes: 73c4d1b307ae ("net: lan743x: select FIXED_PHY")
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: lore.kernel.org/r/202309261802.JPbRHwti-lkp@intel.com
Cc: Bryan Whitehead &lt;bryan.whitehead@microchip.com&gt;
Cc: UNGLinuxDriver@microchip.com
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Tested-by: Simon Horman &lt;horms@kernel.org&gt; # build-tested
Link: https://lore.kernel.org/r/20231002193544.14529-1-rdunlap@infradead.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since FIXED_PHY depends on PHYLIB, PHYLIB needs to be set to avoid
a kconfig warning:

WARNING: unmet direct dependencies detected for FIXED_PHY
  Depends on [n]: NETDEVICES [=y] &amp;&amp; PHYLIB [=n]
  Selected by [y]:
  - LAN743X [=y] &amp;&amp; NETDEVICES [=y] &amp;&amp; ETHERNET [=y] &amp;&amp; NET_VENDOR_MICROCHIP [=y] &amp;&amp; PCI [=y] &amp;&amp; PTP_1588_CLOCK_OPTIONAL [=y]

Fixes: 73c4d1b307ae ("net: lan743x: select FIXED_PHY")
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: lore.kernel.org/r/202309261802.JPbRHwti-lkp@intel.com
Cc: Bryan Whitehead &lt;bryan.whitehead@microchip.com&gt;
Cc: UNGLinuxDriver@microchip.com
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Tested-by: Simon Horman &lt;horms@kernel.org&gt; # build-tested
Link: https://lore.kernel.org/r/20231002193544.14529-1-rdunlap@infradead.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Fix possible memory leaks in vcap_api_kunit</title>
<updated>2023-09-15T06:32:35+00:00</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2023-09-12T11:03:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2a2dffd911d4139258b828b9c5056cb64b826758'/>
<id>2a2dffd911d4139258b828b9c5056cb64b826758</id>
<content type='text'>
Inject fault while probing kunit-example-test.ko, the duprule which
is allocated by kzalloc in vcap_dup_rule() of
test_vcap_xn_rule_creator() is not freed, and it cause the memory leaks
below. Use vcap_del_rule() to free them as other functions do it.

unreferenced object 0xffff6eb4846f6180 (size 192):
  comm "kunit_try_catch", pid 405, jiffies 4294895522 (age 880.004s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 0a 00 00 00 f4 01 00 00  .'..............
    00 00 00 00 00 00 00 00 98 61 6f 84 b4 6e ff ff  .........ao..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000d2ac4ccb&gt;] vcap_api_rule_insert_in_order_test+0xa4/0x114
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4846f6240 (size 192):
  comm "kunit_try_catch", pid 405, jiffies 4294895524 (age 879.996s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 14 00 00 00 90 01 00 00  .'..............
    00 00 00 00 00 00 00 00 58 62 6f 84 b4 6e ff ff  ........Xbo..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;0000000052e6ad35&gt;] vcap_api_rule_insert_in_order_test+0xbc/0x114
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4846f6300 (size 192):
  comm "kunit_try_catch", pid 405, jiffies 4294895524 (age 879.996s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 1e 00 00 00 2c 01 00 00  .'..........,...
    00 00 00 00 00 00 00 00 18 63 6f 84 b4 6e ff ff  .........co..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;000000001b0895d4&gt;] vcap_api_rule_insert_in_order_test+0xd4/0x114
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4846f63c0 (size 192):
  comm "kunit_try_catch", pid 405, jiffies 4294895524 (age 880.012s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 28 00 00 00 c8 00 00 00  .'......(.......
    00 00 00 00 00 00 00 00 d8 63 6f 84 b4 6e ff ff  .........co..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000134c151f&gt;] vcap_api_rule_insert_in_order_test+0xec/0x114
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4845fc180 (size 192):
  comm "kunit_try_catch", pid 407, jiffies 4294895527 (age 880.000s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 14 00 00 00 c8 00 00 00  .'..............
    00 00 00 00 00 00 00 00 98 c1 5f 84 b4 6e ff ff  .........._..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000fa5f64d3&gt;] vcap_api_rule_insert_reverse_order_test+0xc8/0x600
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4845fc240 (size 192):
  comm "kunit_try_catch", pid 407, jiffies 4294895527 (age 880.000s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 1e 00 00 00 2c 01 00 00  .'..........,...
    00 00 00 00 00 00 00 00 58 c2 5f 84 b4 6e ff ff  ........X._..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000453dcd80&gt;] vcap_add_rule+0x134/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000a7db42de&gt;] vcap_api_rule_insert_reverse_order_test+0x108/0x600
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4845fc300 (size 192):
  comm "kunit_try_catch", pid 407, jiffies 4294895527 (age 880.000s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 28 00 00 00 90 01 00 00  .'......(.......
    00 00 00 00 00 00 00 00 18 c3 5f 84 b4 6e ff ff  .........._..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000453dcd80&gt;] vcap_add_rule+0x134/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000ea416c94&gt;] vcap_api_rule_insert_reverse_order_test+0x150/0x600
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4845fc3c0 (size 192):
  comm "kunit_try_catch", pid 407, jiffies 4294895527 (age 880.020s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 32 00 00 00 f4 01 00 00  .'......2.......
    00 00 00 00 00 00 00 00 d8 c3 5f 84 b4 6e ff ff  .........._..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000453dcd80&gt;] vcap_add_rule+0x134/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000764a39b4&gt;] vcap_api_rule_insert_reverse_order_test+0x198/0x600
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb484cd4240 (size 192):
  comm "kunit_try_catch", pid 413, jiffies 4294895543 (age 879.956s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 1e 00 00 00 2c 01 00 00  .'..........,...
    00 00 00 00 00 00 00 00 58 42 cd 84 b4 6e ff ff  ........XB...n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;0000000023976dd4&gt;] vcap_api_rule_remove_in_front_test+0x158/0x658
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb484cd4300 (size 192):
  comm "kunit_try_catch", pid 413, jiffies 4294895543 (age 879.956s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 28 00 00 00 c8 00 00 00  .'......(.......
    00 00 00 00 00 00 00 00 18 43 cd 84 b4 6e ff ff  .........C...n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;000000000b4760ff&gt;] vcap_api_rule_remove_in_front_test+0x170/0x658
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20

Fixes: dccc30cc4906 ("net: microchip: sparx5: Add KUNIT test of counters and sorted rules")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Inject fault while probing kunit-example-test.ko, the duprule which
is allocated by kzalloc in vcap_dup_rule() of
test_vcap_xn_rule_creator() is not freed, and it cause the memory leaks
below. Use vcap_del_rule() to free them as other functions do it.

unreferenced object 0xffff6eb4846f6180 (size 192):
  comm "kunit_try_catch", pid 405, jiffies 4294895522 (age 880.004s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 0a 00 00 00 f4 01 00 00  .'..............
    00 00 00 00 00 00 00 00 98 61 6f 84 b4 6e ff ff  .........ao..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000d2ac4ccb&gt;] vcap_api_rule_insert_in_order_test+0xa4/0x114
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4846f6240 (size 192):
  comm "kunit_try_catch", pid 405, jiffies 4294895524 (age 879.996s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 14 00 00 00 90 01 00 00  .'..............
    00 00 00 00 00 00 00 00 58 62 6f 84 b4 6e ff ff  ........Xbo..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;0000000052e6ad35&gt;] vcap_api_rule_insert_in_order_test+0xbc/0x114
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4846f6300 (size 192):
  comm "kunit_try_catch", pid 405, jiffies 4294895524 (age 879.996s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 1e 00 00 00 2c 01 00 00  .'..........,...
    00 00 00 00 00 00 00 00 18 63 6f 84 b4 6e ff ff  .........co..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;000000001b0895d4&gt;] vcap_api_rule_insert_in_order_test+0xd4/0x114
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4846f63c0 (size 192):
  comm "kunit_try_catch", pid 405, jiffies 4294895524 (age 880.012s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 28 00 00 00 c8 00 00 00  .'......(.......
    00 00 00 00 00 00 00 00 d8 63 6f 84 b4 6e ff ff  .........co..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000134c151f&gt;] vcap_api_rule_insert_in_order_test+0xec/0x114
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4845fc180 (size 192):
  comm "kunit_try_catch", pid 407, jiffies 4294895527 (age 880.000s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 14 00 00 00 c8 00 00 00  .'..............
    00 00 00 00 00 00 00 00 98 c1 5f 84 b4 6e ff ff  .........._..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000fa5f64d3&gt;] vcap_api_rule_insert_reverse_order_test+0xc8/0x600
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4845fc240 (size 192):
  comm "kunit_try_catch", pid 407, jiffies 4294895527 (age 880.000s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 1e 00 00 00 2c 01 00 00  .'..........,...
    00 00 00 00 00 00 00 00 58 c2 5f 84 b4 6e ff ff  ........X._..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000453dcd80&gt;] vcap_add_rule+0x134/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000a7db42de&gt;] vcap_api_rule_insert_reverse_order_test+0x108/0x600
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4845fc300 (size 192):
  comm "kunit_try_catch", pid 407, jiffies 4294895527 (age 880.000s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 28 00 00 00 90 01 00 00  .'......(.......
    00 00 00 00 00 00 00 00 18 c3 5f 84 b4 6e ff ff  .........._..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000453dcd80&gt;] vcap_add_rule+0x134/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000ea416c94&gt;] vcap_api_rule_insert_reverse_order_test+0x150/0x600
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb4845fc3c0 (size 192):
  comm "kunit_try_catch", pid 407, jiffies 4294895527 (age 880.020s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 32 00 00 00 f4 01 00 00  .'......2.......
    00 00 00 00 00 00 00 00 d8 c3 5f 84 b4 6e ff ff  .........._..n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000453dcd80&gt;] vcap_add_rule+0x134/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;00000000764a39b4&gt;] vcap_api_rule_insert_reverse_order_test+0x198/0x600
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb484cd4240 (size 192):
  comm "kunit_try_catch", pid 413, jiffies 4294895543 (age 879.956s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 1e 00 00 00 2c 01 00 00  .'..........,...
    00 00 00 00 00 00 00 00 58 42 cd 84 b4 6e ff ff  ........XB...n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;0000000023976dd4&gt;] vcap_api_rule_remove_in_front_test+0x158/0x658
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff6eb484cd4300 (size 192):
  comm "kunit_try_catch", pid 413, jiffies 4294895543 (age 879.956s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 28 00 00 00 c8 00 00 00  .'......(.......
    00 00 00 00 00 00 00 00 18 43 cd 84 b4 6e ff ff  .........C...n..
  backtrace:
    [&lt;00000000f1b5b86e&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000c56cdd9a&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000046ef1b64&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008565145b&gt;] vcap_dup_rule+0x38/0x210
    [&lt;00000000bd9e1f12&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000070a539b1&gt;] test_vcap_xn_rule_creator.constprop.43+0x120/0x330
    [&lt;000000000b4760ff&gt;] vcap_api_rule_remove_in_front_test+0x170/0x658
    [&lt;000000000f88f9cb&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000e848de5a&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000058a88b6b&gt;] kthread+0x124/0x130
    [&lt;00000000891cf28a&gt;] ret_from_fork+0x10/0x20

Fixes: dccc30cc4906 ("net: microchip: sparx5: Add KUNIT test of counters and sorted rules")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Fix possible memory leaks in test_vcap_xn_rule_creator()</title>
<updated>2023-09-15T06:32:35+00:00</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2023-09-12T11:03:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=20146fa73ab8db2ab9f4916bbaf4610646787a09'/>
<id>20146fa73ab8db2ab9f4916bbaf4610646787a09</id>
<content type='text'>
Inject fault while probing kunit-example-test.ko, the rule which
is allocated by kzalloc in vcap_alloc_rule(), the field which is
allocated by kzalloc in vcap_rule_add_action() and
vcap_rule_add_key() is not freed, and it cause the memory leaks
below. Use vcap_free_rule() to free them as other drivers do it.

And since the return rule of test_vcap_xn_rule_creator() is not
used, remove it and switch to void.

unreferenced object 0xffff058383334240 (size 192):
  comm "kunit_try_catch", pid 309, jiffies 4294894222 (age 639.800s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 14 00 00 00 90 01 00 00  .'..............
    00 00 00 00 00 00 00 00 00 81 93 84 83 05 ff ff  ................
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000648fefae&gt;] vcap_alloc_rule+0x17c/0x26c
    [&lt;000000004da16164&gt;] test_vcap_xn_rule_creator.constprop.43+0xac/0x328
    [&lt;00000000231b1097&gt;] vcap_api_rule_insert_in_order_test+0xcc/0x184
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0583849380c0 (size 64):
  comm "kunit_try_catch", pid 309, jiffies 4294894222 (age 639.800s)
  hex dump (first 32 bytes):
    40 81 93 84 83 05 ff ff 68 42 33 83 83 05 ff ff  @.......hB3.....
    22 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  "...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000ee41df9e&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000001cc1bb38&gt;] test_vcap_xn_rule_creator.constprop.43+0xd8/0x328
    [&lt;00000000231b1097&gt;] vcap_api_rule_insert_in_order_test+0xcc/0x184
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff058384938100 (size 64):
  comm "kunit_try_catch", pid 309, jiffies 4294894222 (age 639.800s)
  hex dump (first 32 bytes):
    80 81 93 84 83 05 ff ff 58 42 33 83 83 05 ff ff  ........XB3.....
    7d 00 00 00 01 00 00 00 02 00 00 00 ff 00 00 00  }...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000043c78991&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000ba73cfbe&gt;] vcap_add_type_keyfield+0xfc/0x128
    [&lt;000000002b00f7df&gt;] vcap_val_rule+0x274/0x3e8
    [&lt;00000000e67d2ff5&gt;] test_vcap_xn_rule_creator.constprop.43+0xf0/0x328
    [&lt;00000000231b1097&gt;] vcap_api_rule_insert_in_order_test+0xcc/0x184
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20

unreferenced object 0xffff0583833b6240 (size 192):
  comm "kunit_try_catch", pid 311, jiffies 4294894225 (age 639.844s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 1e 00 00 00 2c 01 00 00  .'..........,...
    00 00 00 00 00 00 00 00 40 91 8f 84 83 05 ff ff  ........@.......
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000648fefae&gt;] vcap_alloc_rule+0x17c/0x26c
    [&lt;000000004da16164&gt;] test_vcap_xn_rule_creator.constprop.43+0xac/0x328
    [&lt;00000000509de3f4&gt;] vcap_api_rule_insert_reverse_order_test+0x10c/0x654
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0583848f9100 (size 64):
  comm "kunit_try_catch", pid 311, jiffies 4294894225 (age 639.844s)
  hex dump (first 32 bytes):
    80 91 8f 84 83 05 ff ff 68 62 3b 83 83 05 ff ff  ........hb;.....
    22 00 00 00 01 00 00 00 00 00 00 00 a5 b4 ff ff  "...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000ee41df9e&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000001cc1bb38&gt;] test_vcap_xn_rule_creator.constprop.43+0xd8/0x328
    [&lt;00000000509de3f4&gt;] vcap_api_rule_insert_reverse_order_test+0x10c/0x654
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0583848f9140 (size 64):
  comm "kunit_try_catch", pid 311, jiffies 4294894225 (age 639.844s)
  hex dump (first 32 bytes):
    c0 91 8f 84 83 05 ff ff 58 62 3b 83 83 05 ff ff  ........Xb;.....
    7d 00 00 00 01 00 00 00 02 00 00 00 ff 00 00 00  }...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000043c78991&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000ba73cfbe&gt;] vcap_add_type_keyfield+0xfc/0x128
    [&lt;000000002b00f7df&gt;] vcap_val_rule+0x274/0x3e8
    [&lt;00000000e67d2ff5&gt;] test_vcap_xn_rule_creator.constprop.43+0xf0/0x328
    [&lt;00000000509de3f4&gt;] vcap_api_rule_insert_reverse_order_test+0x10c/0x654
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20

unreferenced object 0xffff05838264e0c0 (size 192):
  comm "kunit_try_catch", pid 313, jiffies 4294894230 (age 639.864s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 0a 00 00 00 f4 01 00 00  .'..............
    00 00 00 00 00 00 00 00 40 3a 97 84 83 05 ff ff  ........@:......
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000648fefae&gt;] vcap_alloc_rule+0x17c/0x26c
    [&lt;000000004da16164&gt;] test_vcap_xn_rule_creator.constprop.43+0xac/0x328
    [&lt;00000000a29794d8&gt;] vcap_api_rule_remove_at_end_test+0xbc/0xb48
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff058384973a80 (size 64):
  comm "kunit_try_catch", pid 313, jiffies 4294894230 (age 639.864s)
  hex dump (first 32 bytes):
    e8 e0 64 82 83 05 ff ff e8 e0 64 82 83 05 ff ff  ..d.......d.....
    22 00 00 00 01 00 00 00 00 00 00 00 00 80 ff ff  "...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000ee41df9e&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000001cc1bb38&gt;] test_vcap_xn_rule_creator.constprop.43+0xd8/0x328
    [&lt;00000000a29794d8&gt;] vcap_api_rule_remove_at_end_test+0xbc/0xb48
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff058384973a40 (size 64):
  comm "kunit_try_catch", pid 313, jiffies 4294894230 (age 639.880s)
  hex dump (first 32 bytes):
    80 39 97 84 83 05 ff ff d8 e0 64 82 83 05 ff ff  .9........d.....
    7d 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00  }...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000043c78991&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;0000000094335477&gt;] vcap_add_type_keyfield+0xbc/0x128
    [&lt;000000002b00f7df&gt;] vcap_val_rule+0x274/0x3e8
    [&lt;00000000e67d2ff5&gt;] test_vcap_xn_rule_creator.constprop.43+0xf0/0x328
    [&lt;00000000a29794d8&gt;] vcap_api_rule_remove_at_end_test+0xbc/0xb48
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20

unreferenced object 0xffff0583832fa240 (size 192):
  comm "kunit_try_catch", pid 315, jiffies 4294894233 (age 639.920s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 14 00 00 00 90 01 00 00  .'..............
    00 00 00 00 00 00 00 00 00 a1 8b 84 83 05 ff ff  ................
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000648fefae&gt;] vcap_alloc_rule+0x17c/0x26c
    [&lt;000000004da16164&gt;] test_vcap_xn_rule_creator.constprop.43+0xac/0x328
    [&lt;00000000be638a45&gt;] vcap_api_rule_remove_in_middle_test+0xc4/0xb80
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0583848ba0c0 (size 64):
  comm "kunit_try_catch", pid 315, jiffies 4294894233 (age 639.920s)
  hex dump (first 32 bytes):
    40 a1 8b 84 83 05 ff ff 68 a2 2f 83 83 05 ff ff  @.......h./.....
    22 00 00 00 01 00 00 00 00 00 00 00 00 80 ff ff  "...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000ee41df9e&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000001cc1bb38&gt;] test_vcap_xn_rule_creator.constprop.43+0xd8/0x328
    [&lt;00000000be638a45&gt;] vcap_api_rule_remove_in_middle_test+0xc4/0xb80
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0583848ba100 (size 64):
  comm "kunit_try_catch", pid 315, jiffies 4294894233 (age 639.920s)
  hex dump (first 32 bytes):
    80 a1 8b 84 83 05 ff ff 58 a2 2f 83 83 05 ff ff  ........X./.....
    7d 00 00 00 01 00 00 00 02 00 00 00 ff 00 00 00  }...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000043c78991&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000ba73cfbe&gt;] vcap_add_type_keyfield+0xfc/0x128
    [&lt;000000002b00f7df&gt;] vcap_val_rule+0x274/0x3e8
    [&lt;00000000e67d2ff5&gt;] test_vcap_xn_rule_creator.constprop.43+0xf0/0x328
    [&lt;00000000be638a45&gt;] vcap_api_rule_remove_in_middle_test+0xc4/0xb80
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20

unreferenced object 0xffff0583827d2180 (size 192):
  comm "kunit_try_catch", pid 317, jiffies 4294894238 (age 639.956s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 14 00 00 00 90 01 00 00  .'..............
    00 00 00 00 00 00 00 00 00 e1 06 83 83 05 ff ff  ................
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000648fefae&gt;] vcap_alloc_rule+0x17c/0x26c
    [&lt;000000004da16164&gt;] test_vcap_xn_rule_creator.constprop.43+0xac/0x328
    [&lt;00000000e1ed8350&gt;] vcap_api_rule_remove_in_front_test+0x144/0x6c0
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff05838306e0c0 (size 64):
  comm "kunit_try_catch", pid 317, jiffies 4294894238 (age 639.956s)
  hex dump (first 32 bytes):
    40 e1 06 83 83 05 ff ff a8 21 7d 82 83 05 ff ff  @........!}.....
    22 00 00 00 01 00 00 00 00 00 00 00 00 80 ff ff  "...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000ee41df9e&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000001cc1bb38&gt;] test_vcap_xn_rule_creator.constprop.43+0xd8/0x328
    [&lt;00000000e1ed8350&gt;] vcap_api_rule_remove_in_front_test+0x144/0x6c0
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff05838306e180 (size 64):
  comm "kunit_try_catch", pid 317, jiffies 4294894238 (age 639.968s)
  hex dump (first 32 bytes):
    98 21 7d 82 83 05 ff ff 00 e1 06 83 83 05 ff ff  .!}.............
    67 00 00 00 00 00 00 00 01 01 00 00 ff 00 00 00  g...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000043c78991&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;000000006ce4945d&gt;] test_add_def_fields+0x84/0x8c
    [&lt;00000000507e0ab6&gt;] vcap_val_rule+0x294/0x3e8
    [&lt;00000000e67d2ff5&gt;] test_vcap_xn_rule_creator.constprop.43+0xf0/0x328
    [&lt;00000000e1ed8350&gt;] vcap_api_rule_remove_in_front_test+0x144/0x6c0
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20

Fixes: dccc30cc4906 ("net: microchip: sparx5: Add KUNIT test of counters and sorted rules")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202309090950.uOTEKQq3-lkp@intel.com/
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Inject fault while probing kunit-example-test.ko, the rule which
is allocated by kzalloc in vcap_alloc_rule(), the field which is
allocated by kzalloc in vcap_rule_add_action() and
vcap_rule_add_key() is not freed, and it cause the memory leaks
below. Use vcap_free_rule() to free them as other drivers do it.

And since the return rule of test_vcap_xn_rule_creator() is not
used, remove it and switch to void.

unreferenced object 0xffff058383334240 (size 192):
  comm "kunit_try_catch", pid 309, jiffies 4294894222 (age 639.800s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 14 00 00 00 90 01 00 00  .'..............
    00 00 00 00 00 00 00 00 00 81 93 84 83 05 ff ff  ................
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000648fefae&gt;] vcap_alloc_rule+0x17c/0x26c
    [&lt;000000004da16164&gt;] test_vcap_xn_rule_creator.constprop.43+0xac/0x328
    [&lt;00000000231b1097&gt;] vcap_api_rule_insert_in_order_test+0xcc/0x184
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0583849380c0 (size 64):
  comm "kunit_try_catch", pid 309, jiffies 4294894222 (age 639.800s)
  hex dump (first 32 bytes):
    40 81 93 84 83 05 ff ff 68 42 33 83 83 05 ff ff  @.......hB3.....
    22 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  "...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000ee41df9e&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000001cc1bb38&gt;] test_vcap_xn_rule_creator.constprop.43+0xd8/0x328
    [&lt;00000000231b1097&gt;] vcap_api_rule_insert_in_order_test+0xcc/0x184
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff058384938100 (size 64):
  comm "kunit_try_catch", pid 309, jiffies 4294894222 (age 639.800s)
  hex dump (first 32 bytes):
    80 81 93 84 83 05 ff ff 58 42 33 83 83 05 ff ff  ........XB3.....
    7d 00 00 00 01 00 00 00 02 00 00 00 ff 00 00 00  }...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000043c78991&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000ba73cfbe&gt;] vcap_add_type_keyfield+0xfc/0x128
    [&lt;000000002b00f7df&gt;] vcap_val_rule+0x274/0x3e8
    [&lt;00000000e67d2ff5&gt;] test_vcap_xn_rule_creator.constprop.43+0xf0/0x328
    [&lt;00000000231b1097&gt;] vcap_api_rule_insert_in_order_test+0xcc/0x184
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20

unreferenced object 0xffff0583833b6240 (size 192):
  comm "kunit_try_catch", pid 311, jiffies 4294894225 (age 639.844s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 1e 00 00 00 2c 01 00 00  .'..........,...
    00 00 00 00 00 00 00 00 40 91 8f 84 83 05 ff ff  ........@.......
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000648fefae&gt;] vcap_alloc_rule+0x17c/0x26c
    [&lt;000000004da16164&gt;] test_vcap_xn_rule_creator.constprop.43+0xac/0x328
    [&lt;00000000509de3f4&gt;] vcap_api_rule_insert_reverse_order_test+0x10c/0x654
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0583848f9100 (size 64):
  comm "kunit_try_catch", pid 311, jiffies 4294894225 (age 639.844s)
  hex dump (first 32 bytes):
    80 91 8f 84 83 05 ff ff 68 62 3b 83 83 05 ff ff  ........hb;.....
    22 00 00 00 01 00 00 00 00 00 00 00 a5 b4 ff ff  "...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000ee41df9e&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000001cc1bb38&gt;] test_vcap_xn_rule_creator.constprop.43+0xd8/0x328
    [&lt;00000000509de3f4&gt;] vcap_api_rule_insert_reverse_order_test+0x10c/0x654
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0583848f9140 (size 64):
  comm "kunit_try_catch", pid 311, jiffies 4294894225 (age 639.844s)
  hex dump (first 32 bytes):
    c0 91 8f 84 83 05 ff ff 58 62 3b 83 83 05 ff ff  ........Xb;.....
    7d 00 00 00 01 00 00 00 02 00 00 00 ff 00 00 00  }...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000043c78991&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000ba73cfbe&gt;] vcap_add_type_keyfield+0xfc/0x128
    [&lt;000000002b00f7df&gt;] vcap_val_rule+0x274/0x3e8
    [&lt;00000000e67d2ff5&gt;] test_vcap_xn_rule_creator.constprop.43+0xf0/0x328
    [&lt;00000000509de3f4&gt;] vcap_api_rule_insert_reverse_order_test+0x10c/0x654
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20

unreferenced object 0xffff05838264e0c0 (size 192):
  comm "kunit_try_catch", pid 313, jiffies 4294894230 (age 639.864s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 0a 00 00 00 f4 01 00 00  .'..............
    00 00 00 00 00 00 00 00 40 3a 97 84 83 05 ff ff  ........@:......
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000648fefae&gt;] vcap_alloc_rule+0x17c/0x26c
    [&lt;000000004da16164&gt;] test_vcap_xn_rule_creator.constprop.43+0xac/0x328
    [&lt;00000000a29794d8&gt;] vcap_api_rule_remove_at_end_test+0xbc/0xb48
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff058384973a80 (size 64):
  comm "kunit_try_catch", pid 313, jiffies 4294894230 (age 639.864s)
  hex dump (first 32 bytes):
    e8 e0 64 82 83 05 ff ff e8 e0 64 82 83 05 ff ff  ..d.......d.....
    22 00 00 00 01 00 00 00 00 00 00 00 00 80 ff ff  "...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000ee41df9e&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000001cc1bb38&gt;] test_vcap_xn_rule_creator.constprop.43+0xd8/0x328
    [&lt;00000000a29794d8&gt;] vcap_api_rule_remove_at_end_test+0xbc/0xb48
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff058384973a40 (size 64):
  comm "kunit_try_catch", pid 313, jiffies 4294894230 (age 639.880s)
  hex dump (first 32 bytes):
    80 39 97 84 83 05 ff ff d8 e0 64 82 83 05 ff ff  .9........d.....
    7d 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00  }...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000043c78991&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;0000000094335477&gt;] vcap_add_type_keyfield+0xbc/0x128
    [&lt;000000002b00f7df&gt;] vcap_val_rule+0x274/0x3e8
    [&lt;00000000e67d2ff5&gt;] test_vcap_xn_rule_creator.constprop.43+0xf0/0x328
    [&lt;00000000a29794d8&gt;] vcap_api_rule_remove_at_end_test+0xbc/0xb48
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20

unreferenced object 0xffff0583832fa240 (size 192):
  comm "kunit_try_catch", pid 315, jiffies 4294894233 (age 639.920s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 14 00 00 00 90 01 00 00  .'..............
    00 00 00 00 00 00 00 00 00 a1 8b 84 83 05 ff ff  ................
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000648fefae&gt;] vcap_alloc_rule+0x17c/0x26c
    [&lt;000000004da16164&gt;] test_vcap_xn_rule_creator.constprop.43+0xac/0x328
    [&lt;00000000be638a45&gt;] vcap_api_rule_remove_in_middle_test+0xc4/0xb80
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0583848ba0c0 (size 64):
  comm "kunit_try_catch", pid 315, jiffies 4294894233 (age 639.920s)
  hex dump (first 32 bytes):
    40 a1 8b 84 83 05 ff ff 68 a2 2f 83 83 05 ff ff  @.......h./.....
    22 00 00 00 01 00 00 00 00 00 00 00 00 80 ff ff  "...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000ee41df9e&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000001cc1bb38&gt;] test_vcap_xn_rule_creator.constprop.43+0xd8/0x328
    [&lt;00000000be638a45&gt;] vcap_api_rule_remove_in_middle_test+0xc4/0xb80
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0583848ba100 (size 64):
  comm "kunit_try_catch", pid 315, jiffies 4294894233 (age 639.920s)
  hex dump (first 32 bytes):
    80 a1 8b 84 83 05 ff ff 58 a2 2f 83 83 05 ff ff  ........X./.....
    7d 00 00 00 01 00 00 00 02 00 00 00 ff 00 00 00  }...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000043c78991&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000ba73cfbe&gt;] vcap_add_type_keyfield+0xfc/0x128
    [&lt;000000002b00f7df&gt;] vcap_val_rule+0x274/0x3e8
    [&lt;00000000e67d2ff5&gt;] test_vcap_xn_rule_creator.constprop.43+0xf0/0x328
    [&lt;00000000be638a45&gt;] vcap_api_rule_remove_in_middle_test+0xc4/0xb80
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20

unreferenced object 0xffff0583827d2180 (size 192):
  comm "kunit_try_catch", pid 317, jiffies 4294894238 (age 639.956s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 14 00 00 00 90 01 00 00  .'..............
    00 00 00 00 00 00 00 00 00 e1 06 83 83 05 ff ff  ................
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000648fefae&gt;] vcap_alloc_rule+0x17c/0x26c
    [&lt;000000004da16164&gt;] test_vcap_xn_rule_creator.constprop.43+0xac/0x328
    [&lt;00000000e1ed8350&gt;] vcap_api_rule_remove_in_front_test+0x144/0x6c0
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff05838306e0c0 (size 64):
  comm "kunit_try_catch", pid 317, jiffies 4294894238 (age 639.956s)
  hex dump (first 32 bytes):
    40 e1 06 83 83 05 ff ff a8 21 7d 82 83 05 ff ff  @........!}.....
    22 00 00 00 01 00 00 00 00 00 00 00 00 80 ff ff  "...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000ee41df9e&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000001cc1bb38&gt;] test_vcap_xn_rule_creator.constprop.43+0xd8/0x328
    [&lt;00000000e1ed8350&gt;] vcap_api_rule_remove_in_front_test+0x144/0x6c0
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff05838306e180 (size 64):
  comm "kunit_try_catch", pid 317, jiffies 4294894238 (age 639.968s)
  hex dump (first 32 bytes):
    98 21 7d 82 83 05 ff ff 00 e1 06 83 83 05 ff ff  .!}.............
    67 00 00 00 00 00 00 00 01 01 00 00 ff 00 00 00  g...............
  backtrace:
    [&lt;000000008585a8f7&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000795eba12&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000061886991&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000043c78991&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;000000006ce4945d&gt;] test_add_def_fields+0x84/0x8c
    [&lt;00000000507e0ab6&gt;] vcap_val_rule+0x294/0x3e8
    [&lt;00000000e67d2ff5&gt;] test_vcap_xn_rule_creator.constprop.43+0xf0/0x328
    [&lt;00000000e1ed8350&gt;] vcap_api_rule_remove_in_front_test+0x144/0x6c0
    [&lt;00000000548b559e&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000663f0105&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;00000000e646f120&gt;] kthread+0x124/0x130
    [&lt;000000005257599e&gt;] ret_from_fork+0x10/0x20

Fixes: dccc30cc4906 ("net: microchip: sparx5: Add KUNIT test of counters and sorted rules")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202309090950.uOTEKQq3-lkp@intel.com/
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Fix possible memory leak in vcap_api_encode_rule_test()</title>
<updated>2023-09-15T06:32:35+00:00</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2023-09-12T11:03:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=89e3af0277388f32d56915a6715c735e4afae5d6'/>
<id>89e3af0277388f32d56915a6715c735e4afae5d6</id>
<content type='text'>
Inject fault while probing kunit-example-test.ko, the duprule which
is allocated in vcap_dup_rule() and the vcap enabled port which
is allocated in vcap_enable() of vcap_enable_lookups in
vcap_api_encode_rule_test() is not freed, and it cause the memory
leaks below.

Use vcap_enable_lookups() with false arg to free the vcap enabled
port as other drivers do it. And use vcap_del_rule() to
free the duprule.

unreferenced object 0xffff677a0278bb00 (size 64):
  comm "kunit_try_catch", pid 388, jiffies 4294895987 (age 1101.840s)
  hex dump (first 32 bytes):
    18 bd a5 82 00 80 ff ff 18 bd a5 82 00 80 ff ff  ................
    40 fe c8 0e be c6 ff ff 00 00 00 00 00 00 00 00  @...............
  backtrace:
    [&lt;000000007d53023a&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;0000000076e3f654&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000034d76721&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000013380a5&gt;] vcap_enable_lookups+0x1c8/0x70c
    [&lt;00000000bbec496b&gt;] vcap_api_encode_rule_test+0x2f8/0xb18
    [&lt;000000002c2bfb7b&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000ff74642b&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;000000004af845ca&gt;] kthread+0x124/0x130
    [&lt;0000000038a000ca&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff677a027803c0 (size 192):
  comm "kunit_try_catch", pid 388, jiffies 4294895988 (age 1101.836s)
  hex dump (first 32 bytes):
    00 12 7a 00 05 00 00 00 0a 00 00 00 64 00 00 00  ..z.........d...
    00 00 00 00 00 00 00 00 d8 03 78 02 7a 67 ff ff  ..........x.zg..
  backtrace:
    [&lt;000000007d53023a&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;0000000076e3f654&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000034d76721&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000c1010131&gt;] vcap_dup_rule+0x34/0x14c
    [&lt;00000000d43c54a4&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000073f1c26d&gt;] vcap_api_encode_rule_test+0x304/0xb18
    [&lt;000000002c2bfb7b&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000ff74642b&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;000000004af845ca&gt;] kthread+0x124/0x130
    [&lt;0000000038a000ca&gt;] ret_from_fork+0x10/0x20

Fixes: c956b9b318d9 ("net: microchip: sparx5: Adding KUNIT tests of key/action values in VCAP API")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Inject fault while probing kunit-example-test.ko, the duprule which
is allocated in vcap_dup_rule() and the vcap enabled port which
is allocated in vcap_enable() of vcap_enable_lookups in
vcap_api_encode_rule_test() is not freed, and it cause the memory
leaks below.

Use vcap_enable_lookups() with false arg to free the vcap enabled
port as other drivers do it. And use vcap_del_rule() to
free the duprule.

unreferenced object 0xffff677a0278bb00 (size 64):
  comm "kunit_try_catch", pid 388, jiffies 4294895987 (age 1101.840s)
  hex dump (first 32 bytes):
    18 bd a5 82 00 80 ff ff 18 bd a5 82 00 80 ff ff  ................
    40 fe c8 0e be c6 ff ff 00 00 00 00 00 00 00 00  @...............
  backtrace:
    [&lt;000000007d53023a&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;0000000076e3f654&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000034d76721&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000013380a5&gt;] vcap_enable_lookups+0x1c8/0x70c
    [&lt;00000000bbec496b&gt;] vcap_api_encode_rule_test+0x2f8/0xb18
    [&lt;000000002c2bfb7b&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000ff74642b&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;000000004af845ca&gt;] kthread+0x124/0x130
    [&lt;0000000038a000ca&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff677a027803c0 (size 192):
  comm "kunit_try_catch", pid 388, jiffies 4294895988 (age 1101.836s)
  hex dump (first 32 bytes):
    00 12 7a 00 05 00 00 00 0a 00 00 00 64 00 00 00  ..z.........d...
    00 00 00 00 00 00 00 00 d8 03 78 02 7a 67 ff ff  ..........x.zg..
  backtrace:
    [&lt;000000007d53023a&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;0000000076e3f654&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;0000000034d76721&gt;] kmalloc_trace+0x40/0x164
    [&lt;00000000c1010131&gt;] vcap_dup_rule+0x34/0x14c
    [&lt;00000000d43c54a4&gt;] vcap_add_rule+0x29c/0x32c
    [&lt;0000000073f1c26d&gt;] vcap_api_encode_rule_test+0x304/0xb18
    [&lt;000000002c2bfb7b&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000ff74642b&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;000000004af845ca&gt;] kthread+0x124/0x130
    [&lt;0000000038a000ca&gt;] ret_from_fork+0x10/0x20

Fixes: c956b9b318d9 ("net: microchip: sparx5: Adding KUNIT tests of key/action values in VCAP API")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Fix memory leak for vcap_api_rule_add_actionvalue_test()</title>
<updated>2023-09-15T06:32:35+00:00</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2023-09-12T11:03:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=39d0ccc185315408e7cecfcaf06d167927b51052'/>
<id>39d0ccc185315408e7cecfcaf06d167927b51052</id>
<content type='text'>
Inject fault while probing kunit-example-test.ko, the field which
is allocated by kzalloc in vcap_rule_add_action() of
vcap_rule_add_action_bit/u32() is not freed, and it cause
the memory leaks below.

unreferenced object 0xffff0276c496b300 (size 64):
  comm "kunit_try_catch", pid 286, jiffies 4294894224 (age 920.072s)
  hex dump (first 32 bytes):
    68 3c 62 82 00 80 ff ff 68 3c 62 82 00 80 ff ff  h&lt;b.....h&lt;b.....
    3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  &lt;...............
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008b41c84d&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;00000000ae66c16c&gt;] vcap_api_rule_add_actionvalue_test+0xa4/0x990
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c496b2c0 (size 64):
  comm "kunit_try_catch", pid 286, jiffies 4294894224 (age 920.072s)
  hex dump (first 32 bytes):
    68 3c 62 82 00 80 ff ff 68 3c 62 82 00 80 ff ff  h&lt;b.....h&lt;b.....
    3c 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  &lt;...............
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008b41c84d&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;00000000607782aa&gt;] vcap_api_rule_add_actionvalue_test+0x100/0x990
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c496b280 (size 64):
  comm "kunit_try_catch", pid 286, jiffies 4294894224 (age 920.072s)
  hex dump (first 32 bytes):
    68 3c 62 82 00 80 ff ff 68 3c 62 82 00 80 ff ff  h&lt;b.....h&lt;b.....
    3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  &lt;...............
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008b41c84d&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000004e640602&gt;] vcap_api_rule_add_actionvalue_test+0x15c/0x990
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c496b240 (size 64):
  comm "kunit_try_catch", pid 286, jiffies 4294894224 (age 920.092s)
  hex dump (first 32 bytes):
    68 3c 62 82 00 80 ff ff 68 3c 62 82 00 80 ff ff  h&lt;b.....h&lt;b.....
    5a 00 00 00 01 00 00 00 32 54 76 98 00 00 00 00  Z.......2Tv.....
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008b41c84d&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;0000000011141bf8&gt;] vcap_api_rule_add_actionvalue_test+0x1bc/0x990
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c496b200 (size 64):
  comm "kunit_try_catch", pid 286, jiffies 4294894224 (age 920.092s)
  hex dump (first 32 bytes):
    68 3c 62 82 00 80 ff ff 68 3c 62 82 00 80 ff ff  h&lt;b.....h&lt;b.....
    28 00 00 00 01 00 00 00 dd cc bb aa 00 00 00 00  (...............
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008b41c84d&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;00000000d5ed3088&gt;] vcap_api_rule_add_actionvalue_test+0x22c/0x990
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20

Fixes: c956b9b318d9 ("net: microchip: sparx5: Adding KUNIT tests of key/action values in VCAP API")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Inject fault while probing kunit-example-test.ko, the field which
is allocated by kzalloc in vcap_rule_add_action() of
vcap_rule_add_action_bit/u32() is not freed, and it cause
the memory leaks below.

unreferenced object 0xffff0276c496b300 (size 64):
  comm "kunit_try_catch", pid 286, jiffies 4294894224 (age 920.072s)
  hex dump (first 32 bytes):
    68 3c 62 82 00 80 ff ff 68 3c 62 82 00 80 ff ff  h&lt;b.....h&lt;b.....
    3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  &lt;...............
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008b41c84d&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;00000000ae66c16c&gt;] vcap_api_rule_add_actionvalue_test+0xa4/0x990
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c496b2c0 (size 64):
  comm "kunit_try_catch", pid 286, jiffies 4294894224 (age 920.072s)
  hex dump (first 32 bytes):
    68 3c 62 82 00 80 ff ff 68 3c 62 82 00 80 ff ff  h&lt;b.....h&lt;b.....
    3c 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  &lt;...............
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008b41c84d&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;00000000607782aa&gt;] vcap_api_rule_add_actionvalue_test+0x100/0x990
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c496b280 (size 64):
  comm "kunit_try_catch", pid 286, jiffies 4294894224 (age 920.072s)
  hex dump (first 32 bytes):
    68 3c 62 82 00 80 ff ff 68 3c 62 82 00 80 ff ff  h&lt;b.....h&lt;b.....
    3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  &lt;...............
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008b41c84d&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;000000004e640602&gt;] vcap_api_rule_add_actionvalue_test+0x15c/0x990
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c496b240 (size 64):
  comm "kunit_try_catch", pid 286, jiffies 4294894224 (age 920.092s)
  hex dump (first 32 bytes):
    68 3c 62 82 00 80 ff ff 68 3c 62 82 00 80 ff ff  h&lt;b.....h&lt;b.....
    5a 00 00 00 01 00 00 00 32 54 76 98 00 00 00 00  Z.......2Tv.....
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008b41c84d&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;0000000011141bf8&gt;] vcap_api_rule_add_actionvalue_test+0x1bc/0x990
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c496b200 (size 64):
  comm "kunit_try_catch", pid 286, jiffies 4294894224 (age 920.092s)
  hex dump (first 32 bytes):
    68 3c 62 82 00 80 ff ff 68 3c 62 82 00 80 ff ff  h&lt;b.....h&lt;b.....
    28 00 00 00 01 00 00 00 dd cc bb aa 00 00 00 00  (...............
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;000000008b41c84d&gt;] vcap_rule_add_action+0x104/0x178
    [&lt;00000000d5ed3088&gt;] vcap_api_rule_add_actionvalue_test+0x22c/0x990
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20

Fixes: c956b9b318d9 ("net: microchip: sparx5: Adding KUNIT tests of key/action values in VCAP API")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Fix memory leak for vcap_api_rule_add_keyvalue_test()</title>
<updated>2023-09-15T06:32:35+00:00</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2023-09-12T11:03:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f037fc9905ffa6fa19b89bfbc86946798cede071'/>
<id>f037fc9905ffa6fa19b89bfbc86946798cede071</id>
<content type='text'>
Inject fault while probing kunit-example-test.ko, the field which
is allocated by kzalloc in vcap_rule_add_key() of
vcap_rule_add_key_bit/u32/u128() is not freed, and it cause
the memory leaks below.

unreferenced object 0xffff0276c14b7240 (size 64):
  comm "kunit_try_catch", pid 284, jiffies 4294894220 (age 920.072s)
  hex dump (first 32 bytes):
    28 3c 61 82 00 80 ff ff 28 3c 61 82 00 80 ff ff  (&lt;a.....(&lt;a.....
    67 00 00 00 00 00 00 00 00 01 37 2b af ab ff ff  g.........7+....
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000059ad6bcd&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000ff8002d3&gt;] vcap_api_rule_add_keyvalue_test+0x100/0xba8
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c14b7280 (size 64):
  comm "kunit_try_catch", pid 284, jiffies 4294894221 (age 920.068s)
  hex dump (first 32 bytes):
    28 3c 61 82 00 80 ff ff 28 3c 61 82 00 80 ff ff  (&lt;a.....(&lt;a.....
    67 00 00 00 00 00 00 00 01 01 37 2b af ab ff ff  g.........7+....
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000059ad6bcd&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000f5ac9dc7&gt;] vcap_api_rule_add_keyvalue_test+0x168/0xba8
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c14b72c0 (size 64):
  comm "kunit_try_catch", pid 284, jiffies 4294894221 (age 920.068s)
  hex dump (first 32 bytes):
    28 3c 61 82 00 80 ff ff 28 3c 61 82 00 80 ff ff  (&lt;a.....(&lt;a.....
    67 00 00 00 00 00 00 00 00 00 37 2b af ab ff ff  g.........7+....
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000059ad6bcd&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000c918ae7f&gt;] vcap_api_rule_add_keyvalue_test+0x1d0/0xba8
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c14b7300 (size 64):
  comm "kunit_try_catch", pid 284, jiffies 4294894221 (age 920.084s)
  hex dump (first 32 bytes):
    28 3c 61 82 00 80 ff ff 28 3c 61 82 00 80 ff ff  (&lt;a.....(&lt;a.....
    7d 00 00 00 01 00 00 00 32 54 76 98 ab ff 00 ff  }.......2Tv.....
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000059ad6bcd&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;0000000003352814&gt;] vcap_api_rule_add_keyvalue_test+0x240/0xba8
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c14b7340 (size 64):
  comm "kunit_try_catch", pid 284, jiffies 4294894221 (age 920.084s)
  hex dump (first 32 bytes):
    28 3c 61 82 00 80 ff ff 28 3c 61 82 00 80 ff ff  (&lt;a.....(&lt;a.....
    51 00 00 00 07 00 00 00 17 26 35 44 63 62 71 00  Q........&amp;5Dcbq.
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000059ad6bcd&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;000000001516f109&gt;] vcap_api_rule_add_keyvalue_test+0x2cc/0xba8
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20

Fixes: c956b9b318d9 ("net: microchip: sparx5: Adding KUNIT tests of key/action values in VCAP API")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Inject fault while probing kunit-example-test.ko, the field which
is allocated by kzalloc in vcap_rule_add_key() of
vcap_rule_add_key_bit/u32/u128() is not freed, and it cause
the memory leaks below.

unreferenced object 0xffff0276c14b7240 (size 64):
  comm "kunit_try_catch", pid 284, jiffies 4294894220 (age 920.072s)
  hex dump (first 32 bytes):
    28 3c 61 82 00 80 ff ff 28 3c 61 82 00 80 ff ff  (&lt;a.....(&lt;a.....
    67 00 00 00 00 00 00 00 00 01 37 2b af ab ff ff  g.........7+....
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000059ad6bcd&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000ff8002d3&gt;] vcap_api_rule_add_keyvalue_test+0x100/0xba8
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c14b7280 (size 64):
  comm "kunit_try_catch", pid 284, jiffies 4294894221 (age 920.068s)
  hex dump (first 32 bytes):
    28 3c 61 82 00 80 ff ff 28 3c 61 82 00 80 ff ff  (&lt;a.....(&lt;a.....
    67 00 00 00 00 00 00 00 01 01 37 2b af ab ff ff  g.........7+....
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000059ad6bcd&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000f5ac9dc7&gt;] vcap_api_rule_add_keyvalue_test+0x168/0xba8
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c14b72c0 (size 64):
  comm "kunit_try_catch", pid 284, jiffies 4294894221 (age 920.068s)
  hex dump (first 32 bytes):
    28 3c 61 82 00 80 ff ff 28 3c 61 82 00 80 ff ff  (&lt;a.....(&lt;a.....
    67 00 00 00 00 00 00 00 00 00 37 2b af ab ff ff  g.........7+....
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000059ad6bcd&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;00000000c918ae7f&gt;] vcap_api_rule_add_keyvalue_test+0x1d0/0xba8
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c14b7300 (size 64):
  comm "kunit_try_catch", pid 284, jiffies 4294894221 (age 920.084s)
  hex dump (first 32 bytes):
    28 3c 61 82 00 80 ff ff 28 3c 61 82 00 80 ff ff  (&lt;a.....(&lt;a.....
    7d 00 00 00 01 00 00 00 32 54 76 98 ab ff 00 ff  }.......2Tv.....
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000059ad6bcd&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;0000000003352814&gt;] vcap_api_rule_add_keyvalue_test+0x240/0xba8
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20
unreferenced object 0xffff0276c14b7340 (size 64):
  comm "kunit_try_catch", pid 284, jiffies 4294894221 (age 920.084s)
  hex dump (first 32 bytes):
    28 3c 61 82 00 80 ff ff 28 3c 61 82 00 80 ff ff  (&lt;a.....(&lt;a.....
    51 00 00 00 07 00 00 00 17 26 35 44 63 62 71 00  Q........&amp;5Dcbq.
  backtrace:
    [&lt;0000000028f08898&gt;] slab_post_alloc_hook+0xb8/0x368
    [&lt;00000000514b9b37&gt;] __kmem_cache_alloc_node+0x174/0x290
    [&lt;000000004620684a&gt;] kmalloc_trace+0x40/0x164
    [&lt;0000000059ad6bcd&gt;] vcap_rule_add_key+0x104/0x180
    [&lt;000000001516f109&gt;] vcap_api_rule_add_keyvalue_test+0x2cc/0xba8
    [&lt;00000000fcc5326c&gt;] kunit_try_run_case+0x50/0xac
    [&lt;00000000f5f45b20&gt;] kunit_generic_run_threadfn_adapter+0x20/0x2c
    [&lt;0000000026284079&gt;] kthread+0x124/0x130
    [&lt;0000000024d4a996&gt;] ret_from_fork+0x10/0x20

Fixes: c956b9b318d9 ("net: microchip: sparx5: Adding KUNIT tests of key/action values in VCAP API")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: microchip: vcap api: Fix possible memory leak for vcap_dup_rule()</title>
<updated>2023-09-10T17:51:42+00:00</updated>
<author>
<name>Jinjie Ruan</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2023-09-07T14:03:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=281f65d29d6da1a9b6907fb0b145aaf34f4e4822'/>
<id>281f65d29d6da1a9b6907fb0b145aaf34f4e4822</id>
<content type='text'>
Inject fault When select CONFIG_VCAP_KUNIT_TEST, the below memory leak
occurs. If kzalloc() for duprule succeeds, but the following
kmemdup() fails, the duprule, ckf and caf memory will be leaked. So kfree
them in the error path.

unreferenced object 0xffff122744c50600 (size 192):
  comm "kunit_try_catch", pid 346, jiffies 4294896122 (age 911.812s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 1e 00 00 00 2c 01 00 00  .'..........,...
    00 00 00 00 00 00 00 00 18 06 c5 44 27 12 ff ff  ...........D'...
  backtrace:
    [&lt;00000000394b0db8&gt;] __kmem_cache_alloc_node+0x274/0x2f8
    [&lt;0000000001bedc67&gt;] kmalloc_trace+0x38/0x88
    [&lt;00000000b0612f98&gt;] vcap_dup_rule+0x50/0x460
    [&lt;000000005d2d3aca&gt;] vcap_add_rule+0x8cc/0x1038
    [&lt;00000000eef9d0f8&gt;] test_vcap_xn_rule_creator.constprop.0.isra.0+0x238/0x494
    [&lt;00000000cbda607b&gt;] vcap_api_rule_remove_in_front_test+0x1ac/0x698
    [&lt;00000000c8766299&gt;] kunit_try_run_case+0xe0/0x20c
    [&lt;00000000c4fe9186&gt;] kunit_generic_run_threadfn_adapter+0x50/0x94
    [&lt;00000000f6864acf&gt;] kthread+0x2e8/0x374
    [&lt;0000000022e639b3&gt;] ret_from_fork+0x10/0x20

Fixes: 814e7693207f ("net: microchip: vcap api: Add a storage state to a VCAP rule")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Inject fault When select CONFIG_VCAP_KUNIT_TEST, the below memory leak
occurs. If kzalloc() for duprule succeeds, but the following
kmemdup() fails, the duprule, ckf and caf memory will be leaked. So kfree
them in the error path.

unreferenced object 0xffff122744c50600 (size 192):
  comm "kunit_try_catch", pid 346, jiffies 4294896122 (age 911.812s)
  hex dump (first 32 bytes):
    10 27 00 00 04 00 00 00 1e 00 00 00 2c 01 00 00  .'..........,...
    00 00 00 00 00 00 00 00 18 06 c5 44 27 12 ff ff  ...........D'...
  backtrace:
    [&lt;00000000394b0db8&gt;] __kmem_cache_alloc_node+0x274/0x2f8
    [&lt;0000000001bedc67&gt;] kmalloc_trace+0x38/0x88
    [&lt;00000000b0612f98&gt;] vcap_dup_rule+0x50/0x460
    [&lt;000000005d2d3aca&gt;] vcap_add_rule+0x8cc/0x1038
    [&lt;00000000eef9d0f8&gt;] test_vcap_xn_rule_creator.constprop.0.isra.0+0x238/0x494
    [&lt;00000000cbda607b&gt;] vcap_api_rule_remove_in_front_test+0x1ac/0x698
    [&lt;00000000c8766299&gt;] kunit_try_run_case+0xe0/0x20c
    [&lt;00000000c4fe9186&gt;] kunit_generic_run_threadfn_adapter+0x50/0x94
    [&lt;00000000f6864acf&gt;] kthread+0x2e8/0x374
    [&lt;0000000022e639b3&gt;] ret_from_fork+0x10/0x20

Fixes: 814e7693207f ("net: microchip: vcap api: Add a storage state to a VCAP rule")
Signed-off-by: Jinjie Ruan &lt;ruanjinjie@huawei.com&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: microchip: Remove unused declarations</title>
<updated>2023-08-22T17:31:47+00:00</updated>
<author>
<name>Yue Haibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2023-08-21T13:55:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dff96d7c0cda7cedcbfd382f15fa1c0908e8f317'/>
<id>dff96d7c0cda7cedcbfd382f15fa1c0908e8f317</id>
<content type='text'>
Commit 264a9c5c9dff ("net: sparx5: Remove unused GLAG handling in PGID")
removed sparx5_pgid_alloc_glag() but not its declaration.
Commit 27d293cceee5 ("net: microchip: sparx5: Add support for rule count by cookie")
removed vcap_rule_iter() but not its declaration.
Commit 8beef08f4618 ("net: microchip: sparx5: Adding initial VCAP API support")
declared but never implemented vcap_api_set_client().

Signed-off-by: Yue Haibing &lt;yuehaibing@huawei.com&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Link: https://lore.kernel.org/r/20230821135556.43224-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 264a9c5c9dff ("net: sparx5: Remove unused GLAG handling in PGID")
removed sparx5_pgid_alloc_glag() but not its declaration.
Commit 27d293cceee5 ("net: microchip: sparx5: Add support for rule count by cookie")
removed vcap_rule_iter() but not its declaration.
Commit 8beef08f4618 ("net: microchip: sparx5: Adding initial VCAP API support")
declared but never implemented vcap_api_set_client().

Signed-off-by: Yue Haibing &lt;yuehaibing@huawei.com&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Link: https://lore.kernel.org/r/20230821135556.43224-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: lan743x: Return PTR_ERR() for fixed_phy_register()</title>
<updated>2023-08-20T14:13:27+00:00</updated>
<author>
<name>Ruan Jinjie</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2023-08-18T07:07:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=294f48e9b234415cbd8cc4e233d5fbd41e961148'/>
<id>294f48e9b234415cbd8cc4e233d5fbd41e961148</id>
<content type='text'>
fixed_phy_register() returns -EPROBE_DEFER, -EINVAL and -EBUSY,
etc, in addition to -EIO. The Best practice is to return these
error codes with PTR_ERR().

Signed-off-by: Ruan Jinjie &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fixed_phy_register() returns -EPROBE_DEFER, -EINVAL and -EBUSY,
etc, in addition to -EIO. The Best practice is to return these
error codes with PTR_ERR().

Signed-off-by: Ruan Jinjie &lt;ruanjinjie@huawei.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: microchip: sparx5: Update return value check for vcap_get_rule()</title>
<updated>2023-08-19T18:29:23+00:00</updated>
<author>
<name>Ruan Jinjie</name>
<email>ruanjinjie@huawei.com</email>
</author>
<published>2023-08-18T05:05:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=95b358e4d9c7caad3a787f810265458ee477d0ef'/>
<id>95b358e4d9c7caad3a787f810265458ee477d0ef</id>
<content type='text'>
As Simon Horman suggests, update vcap_get_rule() to always
return an ERR_PTR() and update the error detection conditions to
use IS_ERR(), so use IS_ERR() to check the return value.

Signed-off-by: Ruan Jinjie &lt;ruanjinjie@huawei.com&gt;
Suggested-by: Simon Horman &lt;horms@kernel.org&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As Simon Horman suggests, update vcap_get_rule() to always
return an ERR_PTR() and update the error detection conditions to
use IS_ERR(), so use IS_ERR() to check the return value.

Signed-off-by: Ruan Jinjie &lt;ruanjinjie@huawei.com&gt;
Suggested-by: Simon Horman &lt;horms@kernel.org&gt;
Reviewed-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
