id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
a73d4a055622d0973e371382b16a13f9795ffec7
Analyze and fix the following issue in the Linux kernel code: drivers/xen/xenbus: Replace deprecated strcpy in xenbus_transaction_end
Problem Details: strcpy() is deprecated; inline the read-only string instead. Fix the function comment and use bool instead of int while we're at it. Link: https://github.com/KSPP/linux/issues/88 Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Juergen ...
```diff diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 7c6c12925326..bddc714877c1 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -546,18 +546,12 @@ int xenbus_transaction_start(struct xenbus_transaction *t) EXPORT_SYMBOL_GPL(xenbus_transaction_st...
479d186fc946b16c440f57995d5cb2151bfe61c0
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in xdomain.c
Problem Details: Fix typos in xdomain.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c index 9d220ba544ec..63c7be818b2c 100644 --- a/drivers/thunderbolt/xdomain.c +++ b/drivers/thunderbolt/xdomain.c @@ -1951,8 +1951,8 @@ static void tb_xdomain_link_exit(struct tb_xdomain *xd) /** * tb_xdomain_alloc() - Allocate new XDom...
9527d0c5436c02905cb1befe74ff764f6b4ea5b8
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in usb4.c
Problem Details: Fix typos in usb4.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/usb4.c b/drivers/thunderbolt/usb4.c index 76f01713a875..9e810b2ae0b5 100644 --- a/drivers/thunderbolt/usb4.c +++ b/drivers/thunderbolt/usb4.c @@ -284,7 +284,7 @@ int usb4_switch_setup(struct tb_switch *sw) val |= ROUTER_CS_5_PTO; /* * xHCI can be enabled if PCIe tunnel...
c3d53000d2a59c0922615aa10e97161a28a094f2
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in tunnel.c
Problem Details: Fix typos in tunnel.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c index bfa0607b5574..9fa95c595ecc 100644 --- a/drivers/thunderbolt/tunnel.c +++ b/drivers/thunderbolt/tunnel.c @@ -301,7 +301,7 @@ static int tb_pci_set_ext_encapsulation(struct tb_tunnel *tunnel, bool enable) struct tb_port *port = tb_up...
5d463af9818cd4d6206abac59ba32bcd42bf5d7c
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in tmu.c
Problem Details: Fix typos in tmu.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/tmu.c b/drivers/thunderbolt/tmu.c index b22831b41ec0..cf779874c675 100644 --- a/drivers/thunderbolt/tmu.c +++ b/drivers/thunderbolt/tmu.c @@ -400,10 +400,10 @@ static int tmu_mode_init(struct tb_switch *sw) /** * tb_switch_tmu_init() - Initialize switch TMU structures - * @...
836fe732db6068e6d3909c32bfebcf7572a2bbc6
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in tb_regs.h
Problem Details: Fix typos in tb_regs.h. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/tb_regs.h b/drivers/thunderbolt/tb_regs.h index 4e43b47f9f11..c0bf136236e6 100644 --- a/drivers/thunderbolt/tb_regs.h +++ b/drivers/thunderbolt/tb_regs.h @@ -99,7 +99,7 @@ struct tb_cap_extended_long { } __packed; /** - * struct tb_cap_any - Structure capable of hold every c...
20b2af31286b265a2b8cc4bfa237bae3658e0127
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in tb.h
Problem Details: Fix typos in tb.h. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h index 8e2762ff8d51..e96474f17067 100644 --- a/drivers/thunderbolt/tb.h +++ b/drivers/thunderbolt/tb.h @@ -308,7 +308,7 @@ struct tb_port { * struct usb4_port - USB4 port device * @dev: Device for the port * @port: Pointer to the lane 0 adapt...
6cdbf50107cc4697eb65152b3832c0fce12a79e6
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in tb.c
Problem Details: Fix typos in tb.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index 7a3f76a852de..4f5f1dfc0fbf 100644 --- a/drivers/thunderbolt/tb.c +++ b/drivers/thunderbolt/tb.c @@ -322,7 +322,7 @@ static int tb_enable_tmu(struct tb_switch *sw) /* * If both routers at the end of the link are v2 we simply - * enabl...
cafe5dd8bba426b92f233678f166b2295679a4d4
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in switch.c
Problem Details: Fix typos in switch.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index 0e07904aa73b..b3948aad0b95 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -736,9 +736,9 @@ static int tb_init_port(struct tb_port *port) port->cap_usb4 = cap; /* - * USB4 ports the buffers ...
6c1e5744e68935047bfe3bb1dc5d41619eb4feda
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in retimer.c
Problem Details: Fix typos in retimer.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c index 3a0f486a24d5..13d64dbd2bc5 100644 --- a/drivers/thunderbolt/retimer.c +++ b/drivers/thunderbolt/retimer.c @@ -501,7 +501,7 @@ static struct tb_retimer *tb_port_find_retimer(struct tb_port *port, u8 index) * @add: If true also reg...
1c9ad530d36c2890dabb66c81b77e067f2c6100b
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in nhi.c
Problem Details: Fix typos in nhi.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c index 5f63f9b9cf40..ac3b83a05dbc 100644 --- a/drivers/thunderbolt/nhi.c +++ b/drivers/thunderbolt/nhi.c @@ -712,7 +712,7 @@ void tb_ring_start(struct tb_ring *ring) ring_iowrite64desc(ring, ring->descriptors_dma, 0); if (ring->is_tx) { ri...
0370b14fd55cb9590d76cdea20a6ce0e45d6d3c3
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in lc.c
Problem Details: Fix typos in lc.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/lc.c b/drivers/thunderbolt/lc.c index 0891d51ac2e9..4449c28cc5f1 100644 --- a/drivers/thunderbolt/lc.c +++ b/drivers/thunderbolt/lc.c @@ -558,7 +558,7 @@ static int tb_lc_dp_sink_available(struct tb_switch *sw, int sink) return ret; /* - * Sink is available for CM/SW to ...
91c7b372a31751a2cc79cc13fe67b7942b4156ef
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in icm.c
Problem Details: Fix typos in icm.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index 66092febb40d..d339ba835376 100644 --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c @@ -787,7 +787,7 @@ icm_fr_device_connected(struct tb *tb, const struct icm_pkg_header *hdr) * information might have changed for example...
d3726d4e5bd70e2c159ecb9feb43d3eaa6d76020
Analyze and fix the following issue in the Linux kernel code: perf parse-events: Add debug logging to perf_event
Problem Details: If verbose is enabled and parse_event is called, typically by tests, log failures. Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
```diff diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 0c0dc20b1c13..e522082c5a21 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -2236,6 +2236,8 @@ int parse_event(struct evlist *evlist, const char *str) parse_events_error__init(&err); ret =...
4994e9a711a9de736c0d898e86e5b10b860d7e4f
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in domain.c
Problem Details: Fix typos in domain.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c index 83defc915d33..3ced37b4a869 100644 --- a/drivers/thunderbolt/domain.c +++ b/drivers/thunderbolt/domain.c @@ -376,7 +376,7 @@ struct tb *tb_domain_alloc(struct tb_nhi *nhi, int timeout_msec, size_t privsize struct tb *tb; /* - *...
b719f112d250d56b5b019c8414393d7e068efbb6
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in debugfs.c
Problem Details: Fix typos in debugfs.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/debugfs.c b/drivers/thunderbolt/debugfs.c index 46a2a3550be7..45266ec72f88 100644 --- a/drivers/thunderbolt/debugfs.c +++ b/drivers/thunderbolt/debugfs.c @@ -201,7 +201,7 @@ static bool parse_line(char **line, u32 *offs, u32 *val, int short_fmt_len, #if IS_ENABLED(CONFIG_USB4_D...
d0d7c4062d321bd8cf187db6d9b0d4eb8b0650ef
Analyze and fix the following issue in the Linux kernel code: thunderbolt: Fix typos in ctl.c
Problem Details: Fix typos in ctl.c. No functional changes. Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
```diff diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c index f92175ee3841..d7a535671404 100644 --- a/drivers/thunderbolt/ctl.c +++ b/drivers/thunderbolt/ctl.c @@ -412,7 +412,7 @@ static void tb_ctl_rx_submit(struct ctl_pkg *pkg) * We ignore failures during stop. * All rx packet...
38367a22abba12b9ecd66536ff62274f0afbcf6f
Analyze and fix the following issue in the Linux kernel code: perf sample: Fix the wrong format specifier
Problem Details: In the file tools/perf/util/cs-etm.c, queue_nr is of type unsigned int and should be printed with %u. Signed-off-by: liujing <liujing@cmss.chinamobile.com> Reviewed-by: Mike Leach <mike.leach@linaro.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
```diff diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 62812bef1edf..25d56e0f1c07 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -777,7 +777,7 @@ static void cs_etm__packet_dump(const char *pkt_string, void *data) char queue_nr[64]; if (verbose) - snprintf(queue_n...
bd4b5902e7b647f0dbea1b9426d664ae00186159
Analyze and fix the following issue in the Linux kernel code: docs: zh_CN: scsi: fix broken references in scsi-parameters.rst
Problem Details: 0day CI reported several broken references under Documentation/translations/zh_CN/scsi/scsi-parameters.rst. These files do not exist under the translations directory. The correct references are the original English documents under Documentation/scsi/. This patch updates all broken paths accordingly. ...
```diff diff --git a/Documentation/translations/zh_CN/scsi/scsi-parameters.rst b/Documentation/translations/zh_CN/scsi/scsi-parameters.rst index 53cdc3094a9a..ace777e070ea 100644 --- a/Documentation/translations/zh_CN/scsi/scsi-parameters.rst +++ b/Documentation/translations/zh_CN/scsi/scsi-parameters.rst @@ -31,16 +31...
7d808bf13943f4c6a6142400bffe14267f6dc997
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/sysfs-kunit: handle alloc failures on damon_sysfs_test_add_targets()
Problem Details: damon_sysfs_test_add_targets() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately c...
```diff diff --git a/mm/damon/tests/sysfs-kunit.h b/mm/damon/tests/sysfs-kunit.h index 7b5c7b307da9..ce7218469f20 100644 --- a/mm/damon/tests/sysfs-kunit.h +++ b/mm/damon/tests/sysfs-kunit.h @@ -45,16 +45,41 @@ static void damon_sysfs_test_add_targets(struct kunit *test) struct damon_ctx *ctx; sysfs_targets = dam...
0a63a0e7570b9b2631dfb8d836dc572709dce39e
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/vaddr-kunit: handle alloc failures on damon_test_split_evenly_succ()
Problem Details: damon_test_split_evenly_succ() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately c...
```diff diff --git a/mm/damon/tests/vaddr-kunit.h b/mm/damon/tests/vaddr-kunit.h index 1b0f21c2e376..30dc5459f1d2 100644 --- a/mm/damon/tests/vaddr-kunit.h +++ b/mm/damon/tests/vaddr-kunit.h @@ -284,10 +284,17 @@ static void damon_test_split_evenly_succ(struct kunit *test, unsigned long start, unsigned long end, unsi...
7890e5b5bb6e386155c6e755fe70e0cdcc77f18e
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/vaddr-kunit: handle alloc failures in damon_test_split_evenly_fail()
Problem Details: damon_test_split_evenly_fail() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately c...
```diff diff --git a/mm/damon/tests/vaddr-kunit.h b/mm/damon/tests/vaddr-kunit.h index 484223f19545..1b0f21c2e376 100644 --- a/mm/damon/tests/vaddr-kunit.h +++ b/mm/damon/tests/vaddr-kunit.h @@ -256,7 +256,16 @@ static void damon_test_split_evenly_fail(struct kunit *test, unsigned long start, unsigned long end, unsi...
2b22d0fcc6320ba29b2122434c1d2f0785fb0a25
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/vaddr-kunit: handle alloc failures on damon_do_test_apply_three_regions()
Problem Details: damon_do_test_apply_three_regions() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriat...
```diff diff --git a/mm/damon/tests/vaddr-kunit.h b/mm/damon/tests/vaddr-kunit.h index fce38dd53cf8..484223f19545 100644 --- a/mm/damon/tests/vaddr-kunit.h +++ b/mm/damon/tests/vaddr-kunit.h @@ -136,8 +136,14 @@ static void damon_do_test_apply_three_regions(struct kunit *test, int i; t = damon_new_target(); + if ...
84be856cc87317bc60ff54bd7c8f8a5aa8f0e2c8
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failures on damon_test_set_filters_default_reject()
Problem Details: damon_test_set_filters_default_reject() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by approp...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index a03ae9ddd88a..a91d798caa70 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -659,6 +659,8 @@ static void damon_test_set_filters_default_reject(struct kunit *test) KUNIT_EXPECT_EQ(test, scheme.ops_filters_...
d14d5671e7c9cc788c5a1edfa94e6f9064275905
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failures on damos_test_filter_out()
Problem Details: damon_test_filter_out() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cleanup ...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 5af8275ffd7d..a03ae9ddd88a 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -542,11 +542,22 @@ static void damos_test_filter_out(struct kunit *test) struct damos_filter *f; f = damos_new_filter(DAMOS_...
3e5c4a1a1737bd79abaaa184233d0f815e62273b
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failure on damos_test_commit_filter()
Problem Details: damon_test_commit_filter() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately clean...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 03c7ac31db5c..5af8275ffd7d 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -516,11 +516,16 @@ static void damos_test_new_filter(struct kunit *test) static void damos_test_commit_filter(struct kunit *tes...
28ab2265e9422ccd81e4beafc0ace90f78de04c4
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failres in damon_test_new_filter()
Problem Details: damon_test_new_filter() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cleanup ...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index b9bd69a57e62..03c7ac31db5c 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -505,6 +505,8 @@ static void damos_test_new_filter(struct kunit *test) struct damos_filter *filter; filter = damos_new_filte...
915a2453d824a9b6bf724e3f970d86ae1d092a61
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failure on damon_test_set_attrs()
Problem Details: damon_test_set_attrs() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cleanup p...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 10c9953581ee..b9bd69a57e62 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -465,6 +465,9 @@ static void damon_test_set_attrs(struct kunit *test) .sample_interval = 5000, .aggr_interval = 100000,}; str...
8cf298c01b7fdb08eef5b6b26d0fe98d48134d72
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failures in damon_test_update_monitoring_result()
Problem Details: damon_test_update_monitoring_result() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropri...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index e38c95f86a68..10c9953581ee 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -429,6 +429,9 @@ static void damon_test_update_monitoring_result(struct kunit *test) struct damon_attrs new_attrs; struct damo...
74d5969995d129fd59dd93b9c7daa6669cb6810f
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failures in damon_test_set_regions()
Problem Details: damon_test_set_regions() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cleanup...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 96c8f1269f44..e38c95f86a68 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -368,13 +368,26 @@ static void damon_test_ops_registration(struct kunit *test) static void damon_test_set_regions(struct kunit *t...
4f835f4e8c863985f15abd69db033c2f66546094
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failures in damon_test_ops_registration()
Problem Details: damon_test_ops_registration() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cl...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 10618cdd188e..96c8f1269f44 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -320,6 +320,9 @@ static void damon_test_ops_registration(struct kunit *test) struct damon_operations ops = {.id = DAMON_OPS_VADD...
eded254cb69044bd4abde87394ea44909708d7c0
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failures on damon_test_split_regions_of()
Problem Details: damon_test_split_regions_of() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cl...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 98f2a3de7cea..10618cdd188e 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -278,15 +278,35 @@ static void damon_test_split_regions_of(struct kunit *test) struct damon_target *t; struct damon_region *r;...
0998d2757218771c59d5ca59ccf13d1542a38f17
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failures on dasmon_test_merge_regions_of()
Problem Details: damon_test_merge_regions_of() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cl...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index e8219fd23318..98f2a3de7cea 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -248,8 +248,14 @@ static void damon_test_merge_regions_of(struct kunit *test) int i; t = damon_new_target(); + if (!t) + ku...
3d443dd29a1db7efa587a4bb0c06a497e13ca9e4
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failures on damon_test_merge_two()
Problem Details: damon_test_merge_two() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cleanup p...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index f5f3152cb8df..e8219fd23318 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -188,11 +188,21 @@ static void damon_test_merge_two(struct kunit *test) int i; t = damon_new_target(); + if (!t) + kunit_sk...
5e80d73f22043c59c8ad36452a3253937ed77955
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle alloc failures on damon_test_split_at()
Problem Details: damon_test_split_at() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cleanup pr...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index fd1e1ecaa2c9..f5f3152cb8df 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -148,8 +148,19 @@ static void damon_test_split_at(struct kunit *test) struct damon_target *t; struct damon_region *r, *r_new; ...
f79f2fc44ebd0ed655239046be3e80e8804b5545
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle memory alloc failure from damon_test_aggregate()
Problem Details: damon_test_aggregate() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cleanup p...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 6e8a605277a3..fd1e1ecaa2c9 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -97,8 +97,15 @@ static void damon_test_aggregate(struct kunit *test) struct damon_region *r; int it, ir; + if (!ctx) + kuni...
fafe953de2c661907c94055a2497c6b8dbfd26f3
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle memory failure from damon_test_target()
Problem Details: damon_test_target() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cleanup pre-...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index a2c9ee7a5de1..6e8a605277a3 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -58,7 +58,14 @@ static void damon_test_target(struct kunit *test) struct damon_ctx *c = damon_new_ctx(); struct damon_target *...
e16fdd4f754048d6e23c56bd8d920b71e41e3777
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: handle allocation failures in damon_test_regions()
Problem Details: damon_test_regions() is assuming all dynamic memory allocation in it will succeed. Those are indeed likely in the real use cases since those allocations are too small to fail, but theoretically those could fail. In the case, inappropriate memory access can happen. Fix it by appropriately cleanup pre...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 69ca44f9270b..a2c9ee7a5de1 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -20,11 +20,17 @@ static void damon_test_regions(struct kunit *test) struct damon_target *t; r = damon_new_region(1, 2); + if...
b5ab490d85b772bc99d2648182a282f39f08feb6
Analyze and fix the following issue in the Linux kernel code: mm/damon/tests/core-kunit: fix memory leak in damon_test_set_filters_default_reject()
Problem Details: Patch series "mm/damon/tests: fix memory bugs in kunit tests". DAMON kunit tests were initially written assuming those will be run on environments that are well controlled and therefore tolerant to transient test failures and bugs in the test code itself. The user-mode linux based manual run of the t...
```diff diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 51369e35298b..69ca44f9270b 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -598,6 +598,9 @@ static void damon_test_set_filters_default_reject(struct kunit *test) */ KUNIT_EXPECT_EQ(test, scheme.core_f...
77a7cfd96c17f2414a8319c28a12ff69b36e626a
Analyze and fix the following issue in the Linux kernel code: mm/debug: fix missing space in case statement
Problem Details: In setup_vm_debug() , the case statement for 'p' option is written as 'case'p':' without a space between 'case' and the character constant. While this is syntactically valid C, it violates the Linux kernel coding style, which requires a space after 'case'. This patch adds the missing space to comply ...
```diff diff --git a/mm/debug.c b/mm/debug.c index 64ddb0c4b4be..d860864063be 100644 --- a/mm/debug.c +++ b/mm/debug.c @@ -327,7 +327,7 @@ static int __init setup_vm_debug(char *str) while (*str) { switch (tolower(*str)) { - case'p': + case 'p': __page_init_poisoning = true; break; default: ```
8bc7ba3d265d6ee698de4b1941b7e8f7d91a0562
Analyze and fix the following issue in the Linux kernel code: mm: change type of state in struct memory_block
Problem Details: The state of a memory block should be restricted to values specified in the documentation of the memory hotplug API. However, since the state field in the memory_block struct was defined as an unsigned long, this restriction was not enforced at compile time. With the introduction of the enum memory_b...
```diff diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 6d84a02cfa5d..3d17dd774947 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -198,7 +198,7 @@ static ssize_t state_show(struct device *dev, struct device_attribute *attr, break; default: WARN_ON(1); - return sysfs_emit(buf...
1a4f70f6851a1916c4f0e52731c7ecfe99bf36e6
Analyze and fix the following issue in the Linux kernel code: mm: convert memory block states (MEM_*) macros to enum
Problem Details: Patch series "mm: Convert memory block states (MEM_*) macros to enums", v2. The MEM_* constants indicating the state of a memory block are currently defined as macros, meaning their definitions will be omitted from the debuginfo on most kernel builds. This makes it harder for debuggers to correctly m...
```diff diff --git a/include/linux/memory.h b/include/linux/memory.h index 0c214256216f..f4e358477c6a 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h @@ -64,6 +64,18 @@ struct memory_group { }; }; +enum memory_block_state { + /* These states are exposed to userspace as text strings in sysfs */ + M...
5e0fa7ed984d1c3b8bda4158e35a46cb2b0badac
Analyze and fix the following issue in the Linux kernel code: MAINTAINERS: add include/linux/pgalloc.h to MM CORE section
Problem Details: Patch series "mm: MISC follow-up patches for linux/pgalloc.h", v2. This is a follow-up patch series for the patch series named: "[PATCH V5 mm-hotfixes 0/3] mm, x86: fix crash due to missing page table sync and make it harder to miss". This patch (of 2): Since include/linux/pgtable.h is already list...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index c39701eec3fe..2625bc3d53d8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16266,6 +16266,7 @@ F: include/linux/mmzone.h F: include/linux/mmdebug.h F: include/linux/mmu_notifier.h F: include/linux/pagewalk.h +F: include/linux/pgalloc.h F: include/linux/pgtable.h ...
e35afdf228ccaaafe3baf8034429448ae505be47
Analyze and fix the following issue in the Linux kernel code: mm/damon/sysfs: implement obsolete_target file
Problem Details: There is no good way to remove DAMON targets in the middle of the existing targets list. It restricts efficient and flexible DAMON use cases. Improve the usability by implementing a new DAMON sysfs interface file, namely obsolete_target, under each target directory. It is connected to the obsolete f...
```diff diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 92b53b7ca144..e2bd2d7becdd 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -212,6 +212,7 @@ struct damon_sysfs_target { struct kobject kobj; struct damon_sysfs_regions *regions; int pid; + bool obsolete; }; static struct damon_sysfs_target...
a01386c16dc2d4ef3284c415cfe414f8137e0ea1
Analyze and fix the following issue in the Linux kernel code: Docs/admin-guide/mm/damon/stat: fix a typo: s/sampling events/sampling interval/
Problem Details: It is a contextual typo. Fix it. Link: https://lkml.kernel.org/r/20251026182216.118200-4-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: David Hildenbrand <david@redhat.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.sto...
```diff diff --git a/Documentation/admin-guide/mm/damon/stat.rst b/Documentation/admin-guide/mm/damon/stat.rst index 4c517c2c219a..20f540a9d3d2 100644 --- a/Documentation/admin-guide/mm/damon/stat.rst +++ b/Documentation/admin-guide/mm/damon/stat.rst @@ -17,7 +17,7 @@ DAMON_STAT uses monitoring intervals :ref:`auto-tun...
d7484f6edd31a26a1d32aa1e8e20df40dbc1cb7d
Analyze and fix the following issue in the Linux kernel code: Docs/mm/damon/design: fix wrong link to intervals goal section
Problem Details: Commit b243d666d107 ("Docs/admin-guide/mm/damon/usage: add intervals_goal directory on the hierarchy") mistakenly added a wrong reference for intervals goal usage documentation on the design document. Fix it. Link: https://lkml.kernel.org/r/20251026182216.118200-3-sj@kernel.org Signed-off-by: SeongJa...
```diff diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index b54925ea78e9..2d8d8ca1e0a3 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -381,8 +381,8 @@ That is, assumes 4% (20% of 20%) DAMON-observed access events ratio (source) to capture ...
50ca6423643cdb26871970b4f8870b4940b4c498
Analyze and fix the following issue in the Linux kernel code: mm/damon/core: fix wrong comment of damon_call() return timing
Problem Details: Patch series "mm/damon: misc documentation fixups". First three patches fix up issues in the documents, including wrong explanation of a behavior, wrong link, and a contextual typo. Following five patches update documents for not yet documented features and behaviors. This patch (of 8): damon_call...
```diff diff --git a/mm/damon/core.c b/mm/damon/core.c index 82546d138a5a..769da97fcb26 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1440,7 +1440,7 @@ bool damon_is_running(struct damon_ctx *ctx) * Ask DAMON worker thread (kdamond) of @ctx to call a function with an * argument data that respectively passe...
9fb749cd15078c7bdc46e5d45c37493f83323e33
Analyze and fix the following issue in the Linux kernel code: mm, swap: do not perform synchronous discard during allocation
Problem Details: Patch series "mm, swap: misc cleanup and bugfix", v2. A few cleanups and a bugfix that are either suitable after the swap table phase I or found during code review. Patch 1 is a bugfix and needs to be included in the stable branch, the rest have no behavioral change. This patch (of 5): Since commi...
```diff diff --git a/mm/swapfile.c b/mm/swapfile.c index cb2392ed8e0e..33e0bd905c55 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -1101,13 +1101,6 @@ new_cluster: goto done; } - /* - * We don't have free cluster but have some clusters in discarding, - * do discard now and reclaim them. - */ - if ((si->fl...
72f98ef9a4be30d2a60136dd6faee376f780d06c
Analyze and fix the following issue in the Linux kernel code: iommu: disable SVA when CONFIG_X86 is set
Problem Details: Patch series "Fix stale IOTLB entries for kernel address space", v7. This proposes a fix for a security vulnerability related to IOMMU Shared Virtual Addressing (SVA). In an SVA context, an IOMMU can cache kernel page table entries. When a kernel page table page is freed and reallocated for another ...
```diff diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c index 1a51cfd82808..a0442faad952 100644 --- a/drivers/iommu/iommu-sva.c +++ b/drivers/iommu/iommu-sva.c @@ -77,6 +77,9 @@ struct iommu_sva *iommu_sva_bind_device(struct device *dev, struct mm_struct *mm if (!group) return ERR_PTR(-ENODEV); ...
645a3c4243473d5c8b780927d2cc573e3da5a20c
Analyze and fix the following issue in the Linux kernel code: mm/vmstat: fix indentation in fold_diff function
Problem Details: Adjust misaligned braces in fold_diff() to improve code readability and maintain consistent coding style. [akpm@linux-foundation.org: add braces, per Vlastimil & Liam] Link: https://lkml.kernel.org/r/aPc4I/8zXCGyiapN@pilot-ThinkCentre-M930t-N000 Signed-off-by: Jing Su <jingsusu@didiglobal.com> Acked-b...
```diff diff --git a/mm/vmstat.c b/mm/vmstat.c index 98855f31294d..f226942db746 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -778,17 +778,20 @@ static int fold_diff(int *zone_diff, int *node_diff) int i; bool changed = false; - for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++) + for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; ...
fe62415c9b0da808dab7507dacff588e329f8ff3
Analyze and fix the following issue in the Linux kernel code: mm: remove reference to destructor in comment in calculate_sizes()
Problem Details: The commit that removed support for destructors from kmem_cache_alloc() never removed the comment regarding destructors in the explanation of the possible relocation of the free pointer in calculate_sizes(). Link: https://lkml.kernel.org/r/20251021110004.2209008-1-william.kucharski@oracle.com Fixes: 2...
```diff diff --git a/mm/slub.c b/mm/slub.c index 3ea9b7af660d..477c4f741b2a 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -7901,11 +7901,11 @@ static int calculate_sizes(struct kmem_cache_args *args, struct kmem_cache *s) * permitted to overwrite the first word of the object on * kmem_cache_free. * - * This i...
f0c74b6cb91d97cea74176a5400e89c183732cb2
Analyze and fix the following issue in the Linux kernel code: mm/vmalloc: use kmalloc_array() instead of kmalloc()
Problem Details: The number of NUMA nodes (nr_node_ids) is bounded, so overflow is not a practical concern here. However, using kmalloc_array() better reflects the intent to allocate an array of unsigned ints, and improves consistency with other NUMA-related allocations. No functional change intended. Link: https://...
```diff diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 091a07f6d925..adde450ddf5e 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -5140,7 +5140,7 @@ static int vmalloc_info_show(struct seq_file *m, void *p) unsigned int *counters; if (IS_ENABLED(CONFIG_NUMA)) - counters = kmalloc(nr_node_ids * sizeof(unsigned in...
184c7533426ada7625c029b54143fec4ef4daa28
Analyze and fix the following issue in the Linux kernel code: vmalloc: separate gfp_mask adjunctive parentheses in __vmalloc_node_noprof() kernel-doc comment
Problem Details: Sphinx reports htmldocs warning on __vmalloc_node() comment: Documentation/core-api/mm-api:52: ./mm/vmalloc.c:4036: WARNING: Inline strong start-string without end-string. [docutils] Fix it by separating adjunctive parentheses from preceding gfp_mask formatting markup. Link: https://lkml.kernel.org/...
```diff diff --git a/mm/vmalloc.c b/mm/vmalloc.c index e207ca64a688..091a07f6d925 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -4034,7 +4034,7 @@ fail: * Allocate enough pages to cover @size from the page level allocator with * @gfp_mask flags. Map them into contiguous kernel virtual space. * - * Semantics of...
ab3c8e7b8687a26eacb95ba343de5dad4fb95880
Analyze and fix the following issue in the Linux kernel code: mm/shmem: update shmem to use mmap_prepare
Problem Details: Patch series "expand mmap_prepare functionality, port more users", v5. Since commit c84bf6dd2b83 ("mm: introduce new .mmap_prepare() file callback"), The f_op->mmap hook has been deprecated in favour of f_op->mmap_prepare. This was introduced in order to make it possible for us to eventually eliminat...
```diff diff --git a/mm/shmem.c b/mm/shmem.c index 0eecb486a0cb..8b9fcdd144c8 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2925,16 +2925,17 @@ out_nomem: return retval; } -static int shmem_mmap(struct file *file, struct vm_area_struct *vma) +static int shmem_mmap_prepare(struct vm_area_desc *desc) { + struct file...
dfc02531f413bf18f5e0ac79a52d2af6f69e99c3
Analyze and fix the following issue in the Linux kernel code: mm/damon/reclaim: use min_sz_region for core address alignment when setting regions
Problem Details: When setting regions in DAMON_RECLAIM, DAMON_MIN_REGION will be applied as the core address alignment, and the monitoring target address ranges would be aligned on DAMON_MIN_REGION * addr_unit. When users 1) set addr_unit to a value larger than 1, and 2) set the monitoring target address range as not ...
```diff diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c index e30811cafe90..36a582e09eae 100644 --- a/mm/damon/reclaim.c +++ b/mm/damon/reclaim.c @@ -251,7 +251,7 @@ static int damon_reclaim_apply_parameters(void) err = damon_set_region_biggest_system_ram_default(param_target, &monitor_region_start, ...
e859a224fad65cb4848fe202aea9896a14fdb7f4
Analyze and fix the following issue in the Linux kernel code: mm/damon: add a min_sz_region parameter to damon_set_region_biggest_system_ram_default()
Problem Details: Patch series "mm/damon: fixes for address alignment issues in DAMON_LRU_SORT and DAMON_RECLAIM", v2. In DAMON_LRU_SORT and DAMON_RECLAIM, damon_set_regions() will apply DAMON_MIN_REGION as the core address alignment, and the monitoring target address ranges would be aligned on DAMON_MIN_REGION * addr_...
```diff diff --git a/include/linux/damon.h b/include/linux/damon.h index 0edf41d36ea1..9ee026c2db53 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -961,7 +961,8 @@ int damon_call(struct damon_ctx *ctx, struct damon_call_control *control); int damos_walk(struct damon_ctx *ctx, struct damos_walk_contr...
074f027d15c10cb376b3ad88405b8e512fa5b3a8
Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: guard is_zero_pfn() calls with pte_present()
Problem Details: A non-present entry, like a swap PTE, contains completely different data (swap type and offset). pte_pfn() doesn't know this, so if we feed it a non-present entry, it will spit out a junk PFN. What if that junk PFN happens to match the zeropage's PFN by sheer chance? While really unlikely, this would...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 1be61cd5440d..68e487d53772 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -337,6 +337,13 @@ struct attribute_group khugepaged_attr_group = { }; #endif /* CONFIG_SYSFS */ +static bool pte_none_or_zero(pte_t pte) +{ + if (pte_none(pte)) + return tru...
a059ad48b453ad9ebdefaba6248229e83e5ad4d9
Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: fix comment for default scan sleep duration
Problem Details: The comment for khugepaged_scan_sleep_millisecs incorrectly states the default scan period is 30 seconds. The actual default value in the code is 10000ms (10 seconds). This patch corrects the comment to match the code, preventing potential confusion. The incorrect comment has existed since the featu...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index abe54f0043c7..1be61cd5440d 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -67,7 +67,7 @@ enum scan_result { static struct task_struct *khugepaged_thread __read_mostly; static DEFINE_MUTEX(khugepaged_mutex); -/* default scan 8*512 pte (or vmas) ever...
0acc67c4030c39f39ac90413cc5d0abddd3a9527
Analyze and fix the following issue in the Linux kernel code: mm/page_alloc/vmstat: simplify refresh_cpu_vm_stats change detection
Problem Details: Patch series "mm/page_alloc: Batch callers of free_pcppages_bulk", v5. Motivation & Approach ===================== While testing workloads with high sustained memory pressure on large machines in the Meta fleet (1Tb memory, 316 CPUs), we saw an unexpectedly high number of softlockups. Further invest...
```diff diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 623bee335383..b155929af5b1 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -387,7 +387,7 @@ extern void free_pages(unsigned long addr, unsigned int order); #define free_page(addr) free_pages((addr), 0) void page_alloc_init_cpuhp(void...
eb8762dc220c0b0573100a941bfc68df34ece74f
Analyze and fix the following issue in the Linux kernel code: drivers/base/node: fold register_node() into register_one_node()
Problem Details: Patch series "drivers/base/node: fold node register and unregister functions", v2. The first patch merges register_one_node() and register_node(), leaving a single register_node() function. The second patch merges unregister_one_node() and unregister_node(), leaving a single unregister_node() functio...
```diff diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c index aeb8633a3d00..8c77ec7980de 100644 --- a/arch/powerpc/platforms/pseries/pci_dlpar.c +++ b/arch/powerpc/platforms/pseries/pci_dlpar.c @@ -29,7 +29,7 @@ struct pci_controller *init_phb_dynamic(struct device_n...
a739e6b557af0939ed4031419374f2c563e95b68
Analyze and fix the following issue in the Linux kernel code: mm: vmalloc: WARN_ON if mapping size is not PAGE_SIZE aligned
Problem Details: In mm/vmalloc.c, the function vmap_pte_range() assumes that the mapping size is aligned to PAGE_SIZE. If this assumption is violated, the loop will become infinite because the termination condition (`addr != end`) will never be met. This can lead to overwriting other VA ranges and/or random pages phy...
```diff diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 9a63c91c6150..dcc95931ea9d 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -100,6 +100,9 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct page *page; unsigned long size = PAGE_SIZE; + if (WARN_ON_ONCE(!PAGE_ALIGNED(end - ...
156c0c5d1463c26348316864f7f0dc8bf809f454
Analyze and fix the following issue in the Linux kernel code: mm/page_owner: introduce struct stack_print_ctx
Problem Details: Patch series "mm/page_owner: add debugfs files 'show_handles' and 'show_stacks_handles'", v2. Context: The page_owner debug feature can help understand a particular situation in in a point in time (e.g., identify biggest memory consumers; verify memory counters that do not add up). Another useful us...
```diff diff --git a/mm/page_owner.c b/mm/page_owner.c index 589ec37c94aa..05e26c9d43ef 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -45,6 +45,10 @@ static struct stack failure_stack; static struct stack *stack_list; static DEFINE_SPINLOCK(stack_list_lock); +struct stack_print_ctx { + struct stack *stack; ...
f7ed6bf2372df0123a43cb680d5e63063a9f2d49
Analyze and fix the following issue in the Linux kernel code: mm/zswap: fix typos: s/zwap/zswap/
Problem Details: As the subject says. Link: https://lkml.kernel.org/r/20251003203851.43128-3-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Acked-by: Yosry Ahmed <yosry.ahmed@linux.dev> Acked-by: Nhat Pham <nphamcs@gmail.com> Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev> Cc: Chris Li <chrisl@kerne...
```diff diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4deda33625f4..3ae5cbcaed75 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5443,7 +5443,7 @@ bool obj_cgroup_may_zswap(struct obj_cgroup *objcg) * @size: size of compressed object * * This forces the charge after obj_cgroup_may_zswap() allowed - ...
9f1edf1aedac1b287355f63f768ba4275de72dca
Analyze and fix the following issue in the Linux kernel code: mm: readahead: make thp readahead conditional to mmap_miss logic
Problem Details: Commit 4687fdbb805a ("mm/filemap: Support VM_HUGEPAGE for file mappings") introduced a special handling for VM_HUGEPAGE mappings: even if the readahead is disabled, 1 or 2 HPAGE_PMD_ORDER pages are allocated. This change causes a significant regression for containers with a tight memory.max limit, if ...
```diff diff --git a/mm/filemap.c b/mm/filemap.c index 2f1e7e283a51..526ad8c92250 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3253,11 +3253,47 @@ static struct file *do_sync_mmap_readahead(struct vm_fault *vmf) DEFINE_READAHEAD(ractl, file, ra, mapping, vmf->pgoff); struct file *fpin = NULL; vm_flags_t vm_fl...
590c03ca6a3fbb114396673314e2aa483839608b
Analyze and fix the following issue in the Linux kernel code: mm/ksm: fix exec/fork inheritance support for prctl
Problem Details: Patch series "ksm: fix exec/fork inheritance", v2. This series fixes exec/fork inheritance. See the detailed description of the issue below. This patch (of 2): Background ========== commit d7597f59d1d33 ("mm: add new api to enable ksm per process") introduced MMF_VM_MERGE_ANY for mm->flags, and a...
```diff diff --git a/include/linux/ksm.h b/include/linux/ksm.h index 067538fc4d58..c982694c987b 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h @@ -17,7 +17,7 @@ #ifdef CONFIG_KSM int ksm_madvise(struct vm_area_struct *vma, unsigned long start, unsigned long end, int advice, vm_flags_t *vm_flags); -vm_f...
9c47753167a6a585d0305663c6912f042e131c2d
Analyze and fix the following issue in the Linux kernel code: mm/vmalloc: defer freeing partly initialized vm_struct
Problem Details: __vmalloc_area_node() may call free_vmap_area() or vfree() on error paths, both of which can sleep. This becomes problematic if the function is invoked from an atomic context, such as when GFP_ATOMIC or GFP_NOWAIT is passed via gfp_mask. To fix this, unify error paths and defer the cleanup of partly ...
```diff diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index eb54b7b3202f..1e43181369f1 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -50,7 +50,11 @@ struct iov_iter; /* in uio.h */ #endif struct vm_struct { - struct vm_struct *next; + union { + struct vm_struct *next; /*...
b6c46600bfb28b4be4e9cff7bad4f2cf357e0fb7
Analyze and fix the following issue in the Linux kernel code: mm: fix some typos in mm module
Problem Details: Below are some typos in the code comments: intevals ==> intervals addesses ==> addresses unavaliable ==> unavailable facor ==> factor droping ==> dropping exlusive ==> exclusive decription ==> description confict ==> conflict desriptions ==> descriptions otherwize ==> otherwise v...
```diff diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 3c0d727788c8..0ecd8fb84101 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -1264,7 +1264,7 @@ enum damon_sysfs_cmd { DAMON_SYSFS_CMD_UPDATE_SCHEMES_EFFECTIVE_QUOTAS, /* * @DAMON_SYSFS_CMD_UPDATE_TUNED_INTERVALS: Update the tuned monitoring - ...
e0ac00be7ae844c901e34f426f95bb65ffdae4b4
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx95-tqma9596sa: whitespace fixes
Problem Details: Use tabs instead of spaces for indentation. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi b/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi index 9c892cd8ff21..a4c6083ab43b 100644 --- a/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi +++ b/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi @@ -621,8 +621,8 @@ }; pinctrl_...
0df2b380e5edfd04106a336164fe928c24e9bb7b
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx95-tqma9596sa: update pcie config
Problem Details: Fix pcie clock config and switch from deprecated reset-gpio to reset-gpios. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi b/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi index 832c753abcd7..36da8ff8d183 100644 --- a/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi +++ b/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi @@ -395,22 +395,24 @@ pinctrl-0 = <...
461be3802562b2d41250b40868310579a32f32c1
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx95-tqma9596sa: reduce maximum FlexSPI frequency to 66MHz
Problem Details: 66 MHz is the maximum FlexPI clock frequency in normal/overdrive mode when RXCLKSRC = 0 (Default) Fixes: 91d1ff322c47 ("arm64: dt: imx95: Add TQMa95xxSA") Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi b/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi index c3bb61ea6796..16c40d11d3b5 100644 --- a/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi +++ b/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi @@ -115,7 +115,7 @@ flash0: flash@0...
046cb64923e8c05a8fb656baffcd8c3fc67fb688
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx95-tqma9596sa: fix TPM5 pinctrl node name
Problem Details: tpm4grp will be overwritten. Fix node name Fixes: 91d1ff322c47 ("arm64: dt: imx95: Add TQMa95xxSA") Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi b/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi index 180124cc5bce..c3bb61ea6796 100644 --- a/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi +++ b/arch/arm64/boot/dts/freescale/imx95-tqma9596sa.dtsi @@ -617,7 +617,7 @@ fsl,pins = <IM...
9e510e677090bb794b46348b10e1c8038286e00a
Analyze and fix the following issue in the Linux kernel code: spi: aspeed: Add support for the AST2700 SPI controller
Problem Details: Extend the driver to support the AST2700 SPI controller. Compared to AST2600, AST2700 has the following characteristics: - A 64-bit memory address space. - A 64KB address decoding unit. - Segment registers now use (start <= range < end) semantics, which differs slightly from (start <= range <= en...
```diff diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index d1a8bdf6d540..db3e096f2eb0 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -985,6 +985,41 @@ static u32 aspeed_spi_segment_ast2600_reg(struct aspeed_spi *aspi, ((end - 1) & AST2600_SEG_ADDR_MASK); ...
be6671d3908e97a2128f5327610a1dcb4d420cfa
Analyze and fix the following issue in the Linux kernel code: spi: dt-bindings: aspeed,ast2600-fmc: Add AST2700 SoC support
Problem Details: Add AST2700 to the list of supported SoCs in the ASPEED FMC/SPI bindings. AST2700 FMC/SPI controllers are not compatible with AST2600 due to the following hardware differences: - Address decoding unit uses 64KB granularity (AST2600 uses 1MB). - Segment register semantics are changed. AST2600: star...
```diff diff --git a/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml b/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml index 57d932af4506..80e542624cc6 100644 --- a/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml +++ b/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.ya...
2196e8172bee2002e9baaa0d02b2f9f2dd213949
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: Fix error handling in pm4125 audio codec driver
Problem Details: pm4125_bind() acquires references through pm4125_sdw_device_get() but fails to release them in error paths and during normal unbind operations. This could result in reference count leaks, preventing proper cleanup and potentially causing resource exhaustion over multiple bind/unbind cycles. Calling pa...
```diff diff --git a/sound/soc/codecs/pm4125.c b/sound/soc/codecs/pm4125.c index 706fc668ffe2..f9bcae6d1d79 100644 --- a/sound/soc/codecs/pm4125.c +++ b/sound/soc/codecs/pm4125.c @@ -1551,6 +1551,10 @@ static int pm4125_bind(struct device *dev) struct device_link *devlink; int ret; + /* Initialize device pointers...
578ccfe344c5f421c2c6343b872995b397ffd3ff
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: wcd937x: Fix error handling in wcd937x codec driver
Problem Details: In wcd937x_bind(), the driver calls of_sdw_find_device_by_node() to obtain references to RX and TX SoundWire devices, which increment the device reference counts. However, the corresponding put_device() are missing in both the error paths and the normal unbind path in wcd937x_unbind(). Add proper erro...
```diff diff --git a/sound/soc/codecs/wcd937x.c b/sound/soc/codecs/wcd937x.c index 421ec7a2d6bd..ed0ff45a8964 100644 --- a/sound/soc/codecs/wcd937x.c +++ b/sound/soc/codecs/wcd937x.c @@ -2748,7 +2748,8 @@ static int wcd937x_bind(struct device *dev) wcd937x->rxdev = of_sdw_find_device_by_node(wcd937x->rxnode); if (!...
118eb2cb97b8fc0d515bb0449495959247db58f0
Analyze and fix the following issue in the Linux kernel code: spi: bcm63xx: drop wrong casts in probe()
Problem Details: Both bs->regs and bs->{rx,tx}_io are tagged __iomem, so we shouldn't cast them to anything else. Silences the following sparse warning: drivers/spi/spi-bcm63xx.c:571:22: warning: cast removes address space '__iomem' of expression drivers/spi/spi-bcm63xx.c:571:19: warning: incorrect type in assignment...
```diff diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index b56210734caa..55db5299d725 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -568,8 +568,8 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) host->auto_runtime_pm = true; bs->msg_type_shift = bs->reg...
6b3b697d65d46a0f640216a3f6c72856c159c567
Analyze and fix the following issue in the Linux kernel code: sunrpc: allocate a separate bvec array for socket sends
Problem Details: svc_tcp_sendmsg() calls xdr_buf_to_bvec() with the second slot of rq_bvec as the start, but doesn't reduce the array length by one, which could lead to an array overrun. Also, rq_bvec is always rq_maxpages in length, which can be too short in some cases, since the TCP record marker consumes a slot. Fi...
```diff diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 963bbe251e52..de37069aba90 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h @@ -26,6 +26,9 @@ struct svc_sock { void (*sk_odata)(struct sock *); void (*sk_owspace)(struct sock *); + /* Fo...
cc6c40e09d7b1c559bdf42f0fe99b16eb7cfc5e3
Analyze and fix the following issue in the Linux kernel code: NFSD/blocklayout: Support multiple extents per LAYOUTGET
Problem Details: Allow the pNFS server to respond with multiple extents to a LAYOUTGET request, thereby avoiding unnecessary load on the server and improving performance for the client. The number of LAYOUTGET requests is significantly reduced for various file access patterns, including random and parallel writes. Add...
```diff diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index 6d29ea5e8623..101cccbee4a3 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c @@ -89,9 +89,9 @@ nfsd4_block_proc_layoutget(struct svc_rqst *rqstp, struct inode *inode, { struct nfsd4_layout_seg *seg = &args->lg_seg; struct pnfs_bl...
3524b021b0ec620a76c89aee78e9d4b4130fb711
Analyze and fix the following issue in the Linux kernel code: NFSD/blocklayout: Fix minlength check in proc_layoutget
Problem Details: The extent returned by the file system may have a smaller offset than the segment offset requested by the client. In this case, the minimum segment length must be checked against the requested range. Otherwise, the client may not be able to continue the read/write operation. Fixes: 8650b8a05850 ("nfsd...
```diff diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index fde5539cf6a6..425648565ab2 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c @@ -23,6 +23,7 @@ nfsd4_block_proc_layoutget(struct svc_rqst *rqstp, struct inode *inode, { struct nfsd4_layout_seg *seg = &args->lg_seg; struct super_b...
bf94dea7fd4e6708d1a784be23db65eff84d82f1
Analyze and fix the following issue in the Linux kernel code: svcrdma: Release transport resources synchronously
Problem Details: NFSD has always supported added network listeners. The new netlink protocol now enables the removal of listeners. Olga noticed that if an RDMA listener is removed and immediately re-added, the deferred __svc_rdma_free() function might not have run yet, so some or all of the old listener's RDMA resourc...
```diff diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 3d7f1413df02..b7b318ad25c4 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -591,12 +591,18 @@ static void svc_rdma_detach(struct svc_xprt *xprt) rdma_d...
e2cb69263e797c0aa6676bcef23e9e27e44c83b0
Analyze and fix the following issue in the Linux kernel code: tools: riscv: Fixed misalignment of CSR related definitions
Problem Details: The file tools/arch/riscv/include/asm/csr.h borrows from arch/riscv/include/asm/csr.h, and subsequent modifications related to CSR should maintain consistency. Signed-off-by: Chen Pei <cp0613@linux.alibaba.com> Link: https://patch.msgid.link/20251114071215.816-1-cp0613@linux.alibaba.com [pjw@kernel.or...
```diff diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c index e255c1b069ec..7dd282da67ce 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -1109,7 +1109,7 @@ static irqreturn_t pmu_sbi_ovf_handler(int irq, void *dev) /* compute hardware counter index */ hid...
7b090e7b910cafd245f23e56f3257a151ca0a289
Analyze and fix the following issue in the Linux kernel code: riscv: sbi: Prefer SRST shutdown over legacy
Problem Details: Currently, the sbi_init() always attempts to register the legacy shutdown function as the sys-off handler which is fine when RISCV_SBI_V01 is not enabled. However, if RISCV_SBI_V01 is enabled in the kernel and the SBI v0.1 is not supported by the underlying SBI implementation then the legacy shutdown f...
```diff diff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c index 5e8cde055264..c443337056ab 100644 --- a/arch/riscv/kernel/sbi.c +++ b/arch/riscv/kernel/sbi.c @@ -648,9 +648,9 @@ int sbi_debug_console_read(char *bytes, unsigned int num_bytes) void __init sbi_init(void) { + bool srst_power_off = false; ...
6fe9f3279f7d2518439a7962c5870c6e9ecbadcf
Analyze and fix the following issue in the Linux kernel code: can: gs_usb: gs_usb_receive_bulk_callback(): check actual_length before accessing header
Problem Details: The driver expects to receive a struct gs_host_frame in gs_usb_receive_bulk_callback(). Use struct_group to describe the header of the struct gs_host_frame and check that we have at least received the header before accessing any members of it. To resubmit the URB, do not dereference the pointer chain...
```diff diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c index fa9bab8c89ae..51f8d694104d 100644 --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -262,13 +262,15 @@ struct canfd_quirk { } __packed; struct gs_host_frame { - u32 echo_id; - __le32 can_id; + struct_group(...
516a0cd1c03fa266bb67dd87940a209fd4e53ce7
Analyze and fix the following issue in the Linux kernel code: can: gs_usb: gs_usb_xmit_callback(): fix handling of failed transmitted URBs
Problem Details: The driver lacks the cleanup of failed transfers of URBs. This reduces the number of available URBs per error by 1. This leads to reduced performance and ultimately to a complete stop of the transmission. If the sending of a bulk URB fails do proper cleanup: - increase netdev stats - mark the echo_sbk...
```diff diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c index 69b8d6da651b..fa9bab8c89ae 100644 --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -750,8 +750,21 @@ static void gs_usb_xmit_callback(struct urb *urb) struct gs_can *dev = txc->dev; struct net_device *netd...
30db4451c7f6aabcada029b15859a76962ec0cf8
Analyze and fix the following issue in the Linux kernel code: can: sja1000: fix max irq loop handling
Problem Details: Reading the interrupt register `SJA1000_IR` causes all of its bits to be reset. If we ever reach the condition of handling more than `SJA1000_MAX_IRQ` IRQs, we will have read the register and reset all its bits but without actually handling the interrupt inside of the loop body. This may, among other ...
```diff diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index 4d245857ef1c..83476af8adb5 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c @@ -548,8 +548,8 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) if (priv->read_reg(priv, SJA1000_I...
0c73772cd2b8cc108d5f5334de89ad648d89b9ec
Analyze and fix the following issue in the Linux kernel code: can: kvaser_usb: leaf: Fix potential infinite loop in command parsers
Problem Details: The `kvaser_usb_leaf_wait_cmd()` and `kvaser_usb_leaf_read_bulk_callback` functions contain logic to zero-length commands. These commands are used to align data to the USB endpoint's wMaxPacketSize boundary. The driver attempts to skip these placeholders by aligning the buffer position `pos` to the ne...
```diff diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c index c29828a94ad0..1167d38344f1 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -685,7 +685,7 @@ static int kvaser_usb_leaf_wa...
02d44a1b64f11cdbcd5349063f149309c42a9fa5
Analyze and fix the following issue in the Linux kernel code: iio: pressure: Arrange Makefile alphabetically
Problem Details: Fix hp206c and st_pressure_* entries in pressure Makefiles to follow alphabetical order as per guideline mentioned in iio/pressure/Makefile. Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.co...
```diff diff --git a/drivers/iio/pressure/Makefile b/drivers/iio/pressure/Makefile index 47bf7656f975..a21443e992b9 100644 --- a/drivers/iio/pressure/Makefile +++ b/drivers/iio/pressure/Makefile @@ -16,6 +16,7 @@ obj-$(CONFIG_DPS310) += dps310.o obj-$(CONFIG_IIO_CROS_EC_BARO) += cros_ec_baro.o obj-$(CONFIG_HID_SENSOR...
e89ee35567d3d465ef0715953170be72f5ef1d4c
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8qm-mek: fix mux-controller select/enable-gpios polarity
Problem Details: According to the board design, set SEL to high means flipped connection (TX2/RX2). And the TCPM will output logical 1 if it needs flipped connection. So switch to active high for select-gpios. The EN pin on mux chip is low active, so switch to active low for enable-gpios too. Fixes: b237975b2cd5 ("arm...
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts index 202d5c67ac40..9c0b6b8d6459 100644 --- a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts +++ b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts @@ -217,8 +217,8 @@ compatible = "nxp,cbdtu02043", "gpio-sbu-m...
1107aac1ad7f445a83604b14af7be47f1a795c66
Analyze and fix the following issue in the Linux kernel code: firewire: core: fix to update generation field in topology map
Problem Details: The generation field of topology map is updated after initialized by zero. The updated value of generation field is always zero, and is against specification. This commit fixes the bug. Fixes: 7d138cb269db ("firewire: core: use spin lock specific to topology map") Link: https://lore.kernel.org/r/2025...
```diff diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c index 2f73bcd5696f..ed3ae8cdb0cd 100644 --- a/drivers/firewire/core-topology.c +++ b/drivers/firewire/core-topology.c @@ -441,12 +441,13 @@ static void update_topology_map(__be32 *buffer, size_t buffer_size, int root_nod const...
3b0bf0659551e9df4f3d28a5ce92ea1c51f275a2
Analyze and fix the following issue in the Linux kernel code: arm64: dts: imx8mm-phyboard-polis-peb-av-10: Fix audio codec reset pin ctl
Problem Details: Enable internal pull up of the active low audio codec reset pin. Otherwise the audio codec does not reset properly and is not working. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
```diff diff --git a/arch/arm64/boot/dts/freescale/imx8mm-phyboard-polis-peb-av-10.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-phyboard-polis-peb-av-10.dtsi index 3d4ffeecb8dd..bd1f255e15ea 100644 --- a/arch/arm64/boot/dts/freescale/imx8mm-phyboard-polis-peb-av-10.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mm-phyboar...
798a401660a151633cb171738a72a8f1efb9b0b4
Analyze and fix the following issue in the Linux kernel code: tracefs: fix a leak in eventfs_create_events_dir()
Problem Details: If we have LOCKDOWN_TRACEFS, the function bails out - *after* having locked the parent directory and without bothering to undo that. Just check it before tracefs_start_creating()... Fixes: e24709454c45 "tracefs/eventfs: Add missing lockdown checks" Acked-by: Steven Rostedt (Google) <rostedt@goodmis.o...
```diff diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 8705c77a9e75..93c231601c8e 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -757,7 +757,7 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry const struct eventfs_entry *entries, ...
c460192aae197df1b4db1dca493c35ad529f1b64
Analyze and fix the following issue in the Linux kernel code: fuse_ctl_add_conn(): fix nlink breakage in case of early failure
Problem Details: fuse_ctl_remove_conn() used to decrement the link count of root manually; that got subsumed by simple_recursive_removal(), but in case when subdirectory creation has failed the latter won't get called. Just move the modification of parent's link count into fuse_ctl_add_dentry() to keep the things simp...
```diff diff --git a/fs/fuse/control.c b/fs/fuse/control.c index bb407705603c..5247df896c5d 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c @@ -205,8 +205,7 @@ static const struct file_operations fuse_conn_congestion_threshold_ops = { static struct dentry *fuse_ctl_add_dentry(struct dentry *parent, st...
91f815b7073d8f1abb5f3a3a7bf6b9466a6e5e8f
Analyze and fix the following issue in the Linux kernel code: riscv: Update MIPS vendor id to 0x127
Problem Details: [1] defines MIPS vendor id as 0x127. All previous MIPS RISC-V patches were tested on QEMU, also modified to use 0x722 as MIPS_VENDOR_ID. This new value should reflect real hardware. [1] https://mips.com/wp-content/uploads/2025/06/P8700_Programmers_Reference_Manual_Rev1.84_5-31-2025.pdf Fixes: a8fed1b...
```diff diff --git a/arch/riscv/include/asm/vendorid_list.h b/arch/riscv/include/asm/vendorid_list.h index 3b09874d7a6d..7f5030ee1fcf 100644 --- a/arch/riscv/include/asm/vendorid_list.h +++ b/arch/riscv/include/asm/vendorid_list.h @@ -7,8 +7,8 @@ #define ANDES_VENDOR_ID 0x31e #define MICROCHIP_VENDOR_ID 0x029 +#de...
4e8cb8e0328a4b3ba17905f0051ac98ab709c3ab
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: fixes audio for 100ASK DshanPi A1
Problem Details: Correct the i2c address of the ES8388 chip and the gpio of hp_det pin. According to the schematic, the ES8388 chip is connected to the SoC's sai2 controller instead of sai1, fix it. Fixes: d809417c5a40 ("arm64: dts: rockchip: add DTs for 100ASK DShanPi A1") Signed-off-by: Chukun Pan <amadeus@jmu.edu....
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3576-100ask-dshanpi-a1.dts b/arch/arm64/boot/dts/rockchip/rk3576-100ask-dshanpi-a1.dts index 6c08279953c0..cb04ab96d1e8 100644 --- a/arch/arm64/boot/dts/rockchip/rk3576-100ask-dshanpi-a1.dts +++ b/arch/arm64/boot/dts/rockchip/rk3576-100ask-dshanpi-a1.dts @@ -44,7 +44,...
eaf661552b0f67278d8af4d42e6a5f97ceb0281f
Analyze and fix the following issue in the Linux kernel code: arm64: dts: rockchip: fixes vcc3v3_s0 supply for 100ASK DshanPi A1
Problem Details: From the schematic, the supply of ES8388 chip and the vmmc-supply of SD card both originate from the VCC3V3_S0 regulator, fix it. Fixes: d809417c5a40 ("arm64: dts: rockchip: add DTs for 100ASK DShanPi A1") Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> Link: https://patch.msgid.link/20251101120010.417...
```diff diff --git a/arch/arm64/boot/dts/rockchip/rk3576-100ask-dshanpi-a1.dts b/arch/arm64/boot/dts/rockchip/rk3576-100ask-dshanpi-a1.dts index 7f64dfbf736e..6c08279953c0 100644 --- a/arch/arm64/boot/dts/rockchip/rk3576-100ask-dshanpi-a1.dts +++ b/arch/arm64/boot/dts/rockchip/rk3576-100ask-dshanpi-a1.dts @@ -604,9 +60...
1c2a936edd71e133f2806e68324ec81a4eb07588
Analyze and fix the following issue in the Linux kernel code: mm, swap: fix potential UAF issue for VMA readahead
Problem Details: Since commit 78524b05f1a3 ("mm, swap: avoid redundant swap device pinning"), the common helper for allocating and preparing a folio in the swap cache layer no longer tries to get a swap device reference internally, because all callers of __read_swap_cache_async are already holding a swap entry referenc...
```diff diff --git a/mm/swap_state.c b/mm/swap_state.c index b13e9c4baa90..f4980dde5394 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -748,6 +748,8 @@ static struct folio *swap_vma_readahead(swp_entry_t targ_entry, gfp_t gfp_mask, blk_start_plug(&plug); for (addr = start; addr < end; ilx++, addr += PAGE_S...
216158f063fe24fb003bd7da0cd92cd6e2c4d48b
Analyze and fix the following issue in the Linux kernel code: selftests/user_events: fix type cast for write_index packed member in perf_test
Problem Details: Accessing 'reg.write_index' directly triggers a -Waddress-of-packed-member warning due to potential unaligned pointer access: perf_test.c:239:38: warning: taking address of packed member 'write_index' of class or structure 'user_reg' may result in an unaligned pointer value [-Waddress-of-packed-member...
```diff diff --git a/tools/testing/selftests/user_events/perf_test.c b/tools/testing/selftests/user_events/perf_test.c index 5288e768b207..68625362add2 100644 --- a/tools/testing/selftests/user_events/perf_test.c +++ b/tools/testing/selftests/user_events/perf_test.c @@ -236,7 +236,7 @@ TEST_F(user, perf_empty_events) {...
a26ec8f3d4e56d4a7ffa301e8032dca9df0bbc05
Analyze and fix the following issue in the Linux kernel code: lib/test_kho: check if KHO is enabled
Problem Details: We must check whether KHO is enabled prior to issuing KHO commands, otherwise KHO internal data structures are not initialized. Link: https://lkml.kernel.org/r/20251106220635.2608494-1-pasha.tatashin@soleen.com Fixes: b753522bed0b ("kho: add test for kexec handover") Signed-off-by: Pasha Tatashin <pas...
```diff diff --git a/lib/test_kho.c b/lib/test_kho.c index 60cd899ea745..fff018e5548d 100644 --- a/lib/test_kho.c +++ b/lib/test_kho.c @@ -301,6 +301,9 @@ static int __init kho_test_init(void) phys_addr_t fdt_phys; int err; + if (!kho_is_enabled()) + return 0; + err = kho_retrieve_subtree(KHO_TEST_FDT, &fdt_ph...
f1d47cafe513b5552a5b20a7af0936d9070a8a78
Analyze and fix the following issue in the Linux kernel code: mm/huge_memory: fix folio split check for anon folios in swapcache
Problem Details: Both uniform and non uniform split check missed the check to prevent splitting anon folios in swapcache to non-zero order. Splitting anon folios in swapcache to non-zero order can cause data corruption since swapcache only support PMD order and order-0 entries. This can happen when one use split_huge...
```diff diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 323654fb4f8c..2f2a521e5d68 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3522,7 +3522,8 @@ bool non_uniform_split_supported(struct folio *folio, unsigned int new_order, /* order-1 is not supported for anonymous THP. */ VM_WARN_ONCE(warns &&...
00fbff75c5acb4755f06f08bd1071879c63940c5
Analyze and fix the following issue in the Linux kernel code: crash: fix crashkernel resource shrink
Problem Details: When crashkernel is configured with a high reservation, shrinking its value below the low crashkernel reservation causes two issues: 1. Invalid crashkernel resource objects 2. Kernel crash if crashkernel shrinking is done twice For example, with crashkernel=200M,high, the kernel reserves 200MB of hig...
```diff diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 3b1c43382eec..99dac1aa972a 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -373,7 +373,7 @@ static int __crash_shrink_memory(struct resource *old_res, old_res->start = 0; old_res->end = 0; } else { - crashk_res.end = ram_res->...