id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
12a585e607fa6e3fbe2c02158c7ad284cbf75792
Analyze and fix the following issue in the Linux kernel code: bpf, arm64: Fix redundant MOV and clarify stack arg comments
Problem Details: emit_stack_arg_store_imm() materializes the immediate into tmp and then moves tmp to the target register (x5-x7). Emit the immediate directly into the target register to avoid the redundant MOV. While here, qualify the bare "FP" in the stack-layout ASCII art as "A64_FP" so it is not confused with BPF...
```diff diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index e3bbeaa94590..b4abc3138f37 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -546,7 +546,8 @@ static int build_prologue(struct jit_ctx *ctx, bool ebpf_from_cbpf) * low ...
41300d032a1b1d91a3ed996ad21905463e344beb
Analyze and fix the following issue in the Linux kernel code: libbpf: Skip endianness swap when loader generation failed
Problem Details: bpf_gen__prog_load() byte-swaps the program insns and the {func,line}_info and CO-RE relo blobs in place for cross-endian targets. The blob offsets come from add_data(), which returns 0 on failure: realloc_data_buf() either frees and NULLs gen->data_start (realloc OOM) or returns early on an already-la...
```diff diff --git a/tools/lib/bpf/gen_loader.c b/tools/lib/bpf/gen_loader.c index 492360ca07ea..3702c5944bc0 100644 --- a/tools/lib/bpf/gen_loader.c +++ b/tools/lib/bpf/gen_loader.c @@ -1054,7 +1054,7 @@ void bpf_gen__prog_load(struct bpf_gen *gen, prog_idx, prog_type, insns_off, insn_cnt, license_off); /* con...
3c5e2f1a85844abbb65df4694f5ebad0a13e219c
Analyze and fix the following issue in the Linux kernel code: libbpf: Skip hash computation when loader generation failed
Problem Details: bpf_gen__finish() calls compute_sha_update_offsets() gated only on the gen_hash option, without first consulting gen->error. On a failed generation this is buggy: a failed realloc_data_buf() sets gen->data_start to NULL (leaving gen->data_cur dangling), so compute_sha_update_offsets() runs libbpf_sha25...
```diff diff --git a/tools/lib/bpf/gen_loader.c b/tools/lib/bpf/gen_loader.c index 7b95ced7bcba..3a6e1d53f287 100644 --- a/tools/lib/bpf/gen_loader.c +++ b/tools/lib/bpf/gen_loader.c @@ -397,13 +397,12 @@ int bpf_gen__finish(struct bpf_gen *gen, int nr_progs, int nr_maps) blob_fd_array_off(gen, i)); emit(ge...
e2c88266147ff92ca25e6577158a9a0b3b261a30
Analyze and fix the following issue in the Linux kernel code: libbpf: Drop redundant self-loop in emit_check_err
Problem Details: When the cleanup-label jump offset does not fit in s16, emit_check_err() sets gen->error = -ERANGE and then emits a BPF_JMP_IMM(BPF_JA, 0, 0, -1) self-loop. The latter emit() is dead: gen->error is assigned on the preceding line, and emit() then bails out early in realloc_insn_buf() the moment gen->er...
```diff diff --git a/tools/lib/bpf/gen_loader.c b/tools/lib/bpf/gen_loader.c index 9478b8f78f26..7b95ced7bcba 100644 --- a/tools/lib/bpf/gen_loader.c +++ b/tools/lib/bpf/gen_loader.c @@ -293,7 +293,6 @@ static void emit_check_err(struct bpf_gen *gen) emit(gen, BPF_JMP_IMM(BPF_JSLT, BPF_REG_7, 0, off)); } else { ...
f580d27e8928828693df44ba2db0fffdbe11dfea
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix use-after-free of a deferred file_lock on double SMB2_CANCEL
Problem Details: A deferred byte-range lock (an SMB2_LOCK that blocks) registers an async work on conn->async_requests via setup_async_work(), with cancel_fn = smb2_remove_blocked_lock and cancel_argv[0] pointing at the struct file_lock. When the request is cancelled, the worker frees the file_lock with locks_free_loc...
```diff diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index 620bcfbbfd92..3eb3b1711acb 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -7322,6 +7322,17 @@ int smb2_cancel(struct ksmbd_work *work) le64_to_cpu(hdr->Id.AsyncId)) continue; + /* + * A cancelled defe...
7ce4fc40018de07f05f3035241122d992610dbfb
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix durable reconnect double-bind race in ksmbd_reopen_durable_fd
Problem Details: Two concurrent same-user DHnC reconnects can both observe fp->conn == NULL before either sets it. ksmbd_reopen_durable_fd() checks fp->conn to guard against a handle already being reconnected, but the check and the binding assignment are not atomic: both threads pass the guard, both call ksmbd_conn_get...
```diff diff --git a/fs/smb/server/vfs_cache.c b/fs/smb/server/vfs_cache.c index 4d2d33df6231..ba3355a6057a 100644 --- a/fs/smb/server/vfs_cache.c +++ b/fs/smb/server/vfs_cache.c @@ -1390,19 +1390,19 @@ int ksmbd_reopen_durable_fd(struct ksmbd_work *work, struct ksmbd_file *fp) struct ksmbd_lock *smb_lock; unsigned...
b003086d76968298f22e7cf62239833b5a3a06b1
Analyze and fix the following issue in the Linux kernel code: ksmbd: fix NULL-deref of opinfo->conn in oplock/lease break notifiers
Problem Details: smb2_oplock_break_noti() and smb2_lease_break_noti() read opinfo->conn into a local with neither READ_ONCE() nor a NULL check. Both run from oplock_break() after opinfo_get_list() has dropped ci->m_lock, so a concurrent SMB2 LOGOFF (session_fd_check()) can set op->conn = NULL under ci->m_lock within t...
```diff diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c index 0f5c18520eff..b193dde4810d 100644 --- a/fs/smb/server/oplock.c +++ b/fs/smb/server/oplock.c @@ -711,11 +711,16 @@ out: */ static int smb2_oplock_break_noti(struct oplock_info *opinfo) { - struct ksmbd_conn *conn = opinfo->conn; + struct ksmb...
051a224c4933e58a0592c5528e89831099c65d6b
Analyze and fix the following issue in the Linux kernel code: memblock tests: define MIGRATE_CMA
Problem Details: kho_scratch_migratetype(), defined in include/linux/memblock.h uses enum migratetype. This breaks build for memblock tests with: ./linux/memblock.h:634:73: error: parameter 2 (‘mt’) has incomplete type 634 | enum migratetype mt) Fix it by defin...
```diff diff --git a/tools/testing/memblock/linux/mmzone.h b/tools/testing/memblock/linux/mmzone.h index bb682659a12d..8d934ff5b080 100644 --- a/tools/testing/memblock/linux/mmzone.h +++ b/tools/testing/memblock/linux/mmzone.h @@ -35,4 +35,8 @@ typedef struct pglist_data { } pg_data_t; +enum migratetype { + MIGRAT...
d8e47bd066d7e626f9f45d416182d585b7e18b9b
Analyze and fix the following issue in the Linux kernel code: liveupdate: Reference count incoming FLB data
Problem Details: Increment the incoming FLB refcount in liveupdate_flb_get_incoming() so that the FLB structure cannot be freed while the caller is actively using it. Add an additional liveupdate_flb_put_incoming() function so the caller can explicitly indicate when it is done using the FLB data. During a Live Update,...
```diff diff --git a/include/linux/liveupdate.h b/include/linux/liveupdate.h index 8d3bbc35c828..88722e5caf02 100644 --- a/include/linux/liveupdate.h +++ b/include/linux/liveupdate.h @@ -240,6 +240,8 @@ void liveupdate_unregister_flb(struct liveupdate_file_handler *fh, struct liveupdate_flb *flb); int liv...
d2850ff2f8c5acda4c1097aa53c006a75b091f2c
Analyze and fix the following issue in the Linux kernel code: liveupdate: Use refcount_t for FLB reference counts
Problem Details: Use refcount_t instead of a raw integer to keep track of references on incoming and outgoing FLBs. Using refcount_t provides protection from overflow, underflow, and other issues. Fixes: cab056f2aae7 ("liveupdate: luo_flb: introduce File-Lifecycle-Bound global state") Signed-off-by: David Matlack <dma...
```diff diff --git a/include/linux/liveupdate.h b/include/linux/liveupdate.h index 30c5a39ff9e9..8d3bbc35c828 100644 --- a/include/linux/liveupdate.h +++ b/include/linux/liveupdate.h @@ -12,6 +12,7 @@ #include <linux/kho/abi/luo.h> #include <linux/list.h> #include <linux/mutex.h> +#include <linux/refcount.h> #inclu...
e947433cd0d2b95a277757451b9b9c2714136dc2
Analyze and fix the following issue in the Linux kernel code: liveupdate: reject LIVEUPDATE_IOCTL_CREATE_SESSION with invalid name length
Problem Details: A session name must not be an empty string, and must not exceed the maximum size define in the uapi header, including null termination. Fixes: 0153094d03df ("liveupdate: luo_session: add sessions support") Cc: stable@vger.kernel.org Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com> Reviewed-by: ...
```diff diff --git a/kernel/liveupdate/luo_session.c b/kernel/liveupdate/luo_session.c index 7a42385dabe2..ec7aebc15a80 100644 --- a/kernel/liveupdate/luo_session.c +++ b/kernel/liveupdate/luo_session.c @@ -382,9 +382,13 @@ static int luo_session_getfile(struct luo_session *session, struct file **filep) int luo_sess...
c6073743d0c7f011461bc542c9112180471affad
Analyze and fix the following issue in the Linux kernel code: kho: make preserved pages compatible with deferred struct page init
Problem Details: When CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled, struct page initialization is deferred to parallel kthreads that run later in the boot process. During KHO restoration, kho_preserved_memory_reserve() writes metadata for each preserved memory region. However, if the struct page has not been initialize...
```diff diff --git a/kernel/liveupdate/Kconfig b/kernel/liveupdate/Kconfig index 1a8513f16ef7..c13af38ba23a 100644 --- a/kernel/liveupdate/Kconfig +++ b/kernel/liveupdate/Kconfig @@ -1,12 +1,10 @@ # SPDX-License-Identifier: GPL-2.0-only menu "Live Update and Kexec HandOver" - depends on !DEFERRED_STRUCT_PAGE_INIT ...
bf480c6133461a60e8a4486e560550a20e40ac11
Analyze and fix the following issue in the Linux kernel code: kho: fix deferred initialization of scratch areas
Problem Details: Currently, if CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled, kho_release_scratch() will initialize the struct pages and set migratetype of KHO scratch. Unless the whole scratch fits below first_deferred_pfn, some of that will be overwritten either by deferred_init_pages() or memmap_init_reserved_range()....
```diff diff --git a/include/linux/memblock.h b/include/linux/memblock.h index b0f750d22a7b..5afcd99aa8c1 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -613,11 +613,28 @@ static inline void memtest_report_meminfo(struct seq_file *m) { } #ifdef CONFIG_MEMBLOCK_KHO_SCRATCH void memblock_set_kh...
a73aa3a5685e648e55787b461f6ee0558db4b0c8
Analyze and fix the following issue in the Linux kernel code: sched_ext: Guard BPF arena helper calls to fix 32-bit build
Problem Details: BPF arena (kernel/bpf/arena.c) is compiled only on MMU && 64BIT, while SCHED_CLASS_EXT depends on BPF_SYSCALL && BPF_JIT && DEBUG_INFO_BTF with no 64BIT requirement. On a 32-bit arch with a BPF JIT, SCX builds while the arena helpers are absent, so the cid-form code's unconditional calls to bpf_prog_ar...
```diff diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 83272acf1763..32ebbc351564 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -622,8 +622,12 @@ static inline void scx_call_op_set_cpumask(struct scx_sched *sch, struct rq *rq, if (scx_is_cid_type()) { struct scx_cmask *kern_va = *this_c...
6935f0496c2eb74dd3f57228a799d2db1a8a9ac8
Analyze and fix the following issue in the Linux kernel code: docs: cgroup: Fix stale source file paths
Problem Details: Update two references to files that were moved: - kernel/cgroup.c -> kernel/cgroup/cgroup.c - tools/cgroup/cgroup_event_listener.c -> samples/cgroup/cgroup_event_listener.c Assisted-by: Claude:claude-opus-4-6 Signed-off-by: Costa Shulyupin <costa.shul@redhat.com> Signed-off-by: Tejun Heo <tj@kernel....
```diff diff --git a/Documentation/admin-guide/cgroup-v1/cgroups.rst b/Documentation/admin-guide/cgroup-v1/cgroups.rst index 463f98453323..e501f45ea93f 100644 --- a/Documentation/admin-guide/cgroup-v1/cgroups.rst +++ b/Documentation/admin-guide/cgroup-v1/cgroups.rst @@ -525,7 +525,7 @@ cgroup. It may also be taken to p...
5add3a4ad1a3bc15404e8bd338813ed0a636f5c9
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: add verification for BPF_PROG_QUERY attr size boundaries
Problem Details: Add a new selftest to verify that the BPF syscall (specifically BPF_PROG_QUERY) correctly handles different user-declared attribute sizes. Specifically, verify that: - For cgroup queries, a query with a size that covers 'prog_cnt' but is smaller than 'revision' (OLD_QUERY_SIZE) succeeds, but does no...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_attr_size.c b/tools/testing/selftests/bpf/prog_tests/bpf_attr_size.c new file mode 100644 index 000000000000..32159dc64da8 --- /dev/null +++ b/tools/testing/selftests/bpf/prog_tests/bpf_attr_size.c @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: GPL-2.0 +/* ...
21c4b99b27f3f85b89256e81b3e997dec0a460d0
Analyze and fix the following issue in the Linux kernel code: bpf: fix BPF_PROG_QUERY OOB write and cgroup backward compat
Problem Details: BPF_PROG_QUERY writes back the 'query.revision' field unconditionally to userspace. If userspace passes a smaller 'bpf_attr' structure (e.g. 40 bytes, which was the layout before the addition of 'query.revision'), the kernel performs an out-of-bounds write. Fix this by propagating the user-provided at...
```diff diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h index b2e79c2b41d5..4d0cc65976a1 100644 --- a/include/linux/bpf-cgroup.h +++ b/include/linux/bpf-cgroup.h @@ -421,7 +421,7 @@ int cgroup_bpf_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype); int cgroup_bpf_link_attach(...
ca06d8c68060b754e22eb999b6f35a5b7fc6ae79
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/tas2781: Fix spelling mistake: "Froce" -. "Force"
Problem Details: There is a spelling mistake in a snprintf statement. Fix it. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://patch.msgid.link/20260531101339.42155-1-colin.i.king@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
```diff diff --git a/sound/hda/codecs/side-codecs/tas2781_hda_spi.c b/sound/hda/codecs/side-codecs/tas2781_hda_spi.c index d243baff95a7..0efc476abe8e 100644 --- a/sound/hda/codecs/side-codecs/tas2781_hda_spi.c +++ b/sound/hda/codecs/side-codecs/tas2781_hda_spi.c @@ -593,7 +593,7 @@ static int tas2781_hda_spi_snd_ctls(s...
22fa1c39ba6fe726b547c877c924379b7fee260a
Analyze and fix the following issue in the Linux kernel code: clk: at91: keep securam node alive while mapping it
Problem Details: pmc_register_ops() gets an owned reference to the "atmel,sama5d2-securam" node with of_find_compatible_node(). The success path dropped that reference before passing the node to of_iomap(), leaving of_iomap() to consume a node pointer after the caller had released its reference. Move of_node_put() af...
```diff diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c index b618a5e00b00..03a6c31d6aa8 100644 --- a/drivers/clk/at91/pmc.c +++ b/drivers/clk/at91/pmc.c @@ -180,9 +180,9 @@ static int __init pmc_register_ops(void) of_node_put(np); return -ENODEV; } - of_node_put(np); at91_pmc_backup_suspend = ...
aa2f4addab44407c7aa742321de5dc1914ab5762
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: Set the value of potential sticky mixers to maximum
Problem Details: It makes no sense to restore the saved value for a sticky mixer, since setting any value is a no-op. However, in some rare cases, SET_CUR is effective despite GET_CUR always returns a constant value. These mixers are not sticky, but there's no way to distinguish them. Without any additional informatio...
```diff diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 5fba456eb4a9..fb37bb8ad9a9 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1371,10 +1371,8 @@ static int get_min_max_with_quirks(struct usb_mixer_elem_info *cval, goto no_checks; ret = check_sticky_volume_control(cval, minchn, saved)...
093305d801fae6ff9b8bb531fd78b579794c4f80
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: pcie: simplify the resume flow if fast resume is not used
Problem Details: In most distributions, NetworkManager shuts the device down before entering system suspend, so fast suspend is typically not used. On older devices, resume currently tries to grab NIC access to infer whether the device was powered off while suspended. That probe is only meaningful for the fast-suspend...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c index dc99e7ac4726..eb3c5a6dd088 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c @@ -1225,33 +1225,41 @@ static int _iwl_pci_resume(struct dev...
6a75e3d4f6428b90f398354212e3a2e0172851d6
Analyze and fix the following issue in the Linux kernel code: media: qcom: camss: vfe-340: Support for PIX client
Problem Details: Add support for the vfe-340 PIX write engine, enabling frame capture through the PIX video device (e.g. msm_vfe0_pix). The PIX path requires a separate configuration flow from RDI, including cropping setup, line- based write engine configuration, and the correct packer format based on the input pixel f...
```diff diff --git a/drivers/media/platform/qcom/camss/camss-vfe-340.c b/drivers/media/platform/qcom/camss/camss-vfe-340.c index d129b0d3a6ed..2526d568686d 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe-340.c +++ b/drivers/media/platform/qcom/camss/camss-vfe-340.c @@ -54,6 +54,7 @@ #define TFE_BUS_CLIENT_C...
909d9dc3b5730c8ed7b764c68bc788342df2a07b
Analyze and fix the following issue in the Linux kernel code: raid1: fix nr_pending leak in REQ_ATOMIC bad-block error path
Problem Details: In raid1_write_request(), each per-mirror loop iteration begins by incrementing rdev->nr_pending. If a REQ_ATOMIC write encounters a badblock within the requested range, the code jumps to err_handle without dropping the reference taken for the current mirror. err_handle's cleanup loop will only decrem...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 85a17909d8fe..b1ed4cc6ade4 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1603,8 +1603,10 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio, * complexity of supporting that is not worth * the benefit. ...
6e3b0b91334d1dfaa20ca55eac835f5945a3b7c8
Analyze and fix the following issue in the Linux kernel code: md/raid1: move the exceed_read_errors condition out of fix_read_error
Problem Details: This condition much better fits into the only caller, limiting fix_read_error to actually fix up data devices after a read error. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20260529054308.2720300-3-hch@lst.de Signed-off-by: Yu Kuai <yukuai@fygo.io>
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 98476ab96c52..85a17909d8fe 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2418,11 +2418,6 @@ static void fix_read_error(struct r1conf *conf, struct r1bio *r1_bio) struct mddev *mddev = conf->mddev; struct md_rdev *rdev = conf->mirrors[...
ba976e3501111d11c550848b3b7341a73035f582
Analyze and fix the following issue in the Linux kernel code: md/raid1,raid10: fix bio accounting for split md cloned bios
Problem Details: Use md_cloned_bio() to control bio accounting instead of relying on r1bio_existed in raid1 or the io_accounting flag in raid10. The previous logic does not reliably reflect whether a bio is an md cloned bio. When a failed bio is split and resubmitted via bio_submit_split_bioset() on the error path, th...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 22458df5069e..603aa09088f0 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1418,7 +1418,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio, } r1_bio->read_disk = rdisk; - if (!r1bio_existed) { + if (likely(!md_cl...
811545e0926d02a6a0b1a1258bb5544777c164d4
Analyze and fix the following issue in the Linux kernel code: md/raid1,raid10: fix error-path detection with md_cloned_bio()
Problem Details: Detect the error path using md_cloned_bio() instead of relying on r1_bio in raid1 or r10_bio->read_slot in raid10, which may be NULL or -1 after splitting and resubmitting a failed bio. As a result, the error path may not be recognized and memory allocations can incorrectly use GFP_NOIO instead of (GF...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 64d970e2ef50..22458df5069e 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1343,11 +1343,18 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio, bool r1bio_existed = !!r1_bio; /* - * If r1_bio is set, we are blocki...
7b15c24f805339a585cfe7d72f446b7e88b9bcc0
Analyze and fix the following issue in the Linux kernel code: md/raid1,raid10: fix deadlock in read error recovery path
Problem Details: raid1d and raid10d may resubmit a split md cloned bio while handling a read error. In this case, resubmitting the bio can lead to a deadlock if the array is suspended before md_handle_request() acquires an active_io reference via percpu_ref_tryget_live(). Since the cloned bio already holds an active_i...
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index 6cb2c452f963..096bb64e87bd 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -395,17 +395,24 @@ static bool is_suspended(struct mddev *mddev, struct bio *bio) bool md_handle_request(struct mddev *mddev, struct bio *bio) { check_suspended: - if (is_susp...
6b8a26af065ddc93de2aa5c9f0df98dce9723442
Analyze and fix the following issue in the Linux kernel code: md/raid10: reset read_slot when reusing r10bio for discard
Problem Details: put_all_bios() always drops devs[i].bio, but it only drops devs[i].repl_bio when r10_bio->read_slot < 0. If discard reuses an r10bio that was previously used for a read, read_slot can still be non-negative, and discard cleanup can skip bio_put() on repl_bio. Reset read_slot to -1 when preparing an r10...
```diff diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 39085e7dd6d2..7dc2a5a127e8 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1727,6 +1727,7 @@ retry_discard: r10_bio->mddev = mddev; r10_bio->state = 0; r10_bio->sectors = 0; + r10_bio->read_slot = -1; memset(r10_bio->devs, 0, si...
ae81c43f6c01a441ea8ce77f37903853595b6bb3
Analyze and fix the following issue in the Linux kernel code: iio: temperature: ltc2983: Fix inconsistent channel wording in messages
Problem Details: Replace occurrences of the abbreviated 'chann' and 'chan' with 'channel' in error and debug messages throughout the driver. Also changed the diode invalid channel error message from "thermistor" to "diode". Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Liviu Stan <liviu.stan@ana...
```diff diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 8b0b6b4884f6..fc904c0a42b4 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -699,7 +699,7 @@ ltc2983_thermocouple_new(const struct fwnode_handle *child, struct ltc2983_data if (!(t...
53f4fda3c0efa77bb239dc5e357ae80644fcb400
Analyze and fix the following issue in the Linux kernel code: iio: temperature: ltc2983: Fix macro parenthesization and rename
Problem Details: Wrap the 'chan' parameter in LTC2983_CHAN_START_ADDR() and LTC2983_CHAN_RES_ADDR() with parentheses to prevent potential macro argument expansion issues. Also rename LTC2983_CHAN_START_ADDR to LTC2983_CHAN_ASSIGN_ADDR and LTC2983_CHAN_RES_ADDR to LTC2983_RESULT_ADDR, to better reflect the datasheet nam...
```diff diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 2bc5cd46a72f..4bae90f03002 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -56,10 +56,10 @@ #define LTC2983_EEPROM_WRITE_TIME_MS 2600 #define LTC2983_EEPROM_READ_TIME_MS 20 -#...
5cb9fdb446bfc3ae0524496f53fb68e67051701b
Analyze and fix the following issue in the Linux kernel code: iio: temperature: ltc2983: Fix reinit_completion() called after conversion start
Problem Details: reinit_completion() was called after regmap_write() initiated the hardware conversion, creating a race window where the interrupt could fire and call complete() before reinit_completion() reset the completion. Move reinit_completion() before the regmap_write() to close the race. ltc2983_eeprom_cmd() a...
```diff diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 1f835e326b93..2bc5cd46a72f 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -1177,12 +1177,11 @@ static int ltc2983_chan_read(struct ltc2983_data *st, start_conversion |= LTC2983_S...
434c150752675f44dc52c384a7fa22e5176bc35a
Analyze and fix the following issue in the Linux kernel code: iio: temperature: ltc2983: Fix n_wires default bypassing rotation check
Problem Details: When adi,number-of-wires is absent, n_wires is left at 0. The binding documents a default of 2 wires, matching the hardware default. However the current-rotate validation checks n_wires == 2 || n_wires == 3, so with n_wires = 0 the guard is bypassed and adi,current-rotate is accepted for a 2-wire RTD. ...
```diff diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 38e6f8dfd3b8..1f835e326b93 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -741,7 +741,7 @@ ltc2983_rtd_new(const struct fwnode_handle *child, struct ltc2983_data *st, struct ltc2...
b39f3bb9f5580d19bc0c10dea9224d75fed45f1d
Analyze and fix the following issue in the Linux kernel code: iio: tcs3472: power down chip on probe failure
Problem Details: If tcs3472_probe() fails after enabling the chip (by writing PON | AEN to the ENABLE register), the error paths return without powering down the device. Add an 'error_powerdown' label at the end of the cleanup chain that calls tcs3472_powerdown() to power down the chip. The existing label cascade is r...
```diff diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index 5a14f8d39aa4..6f055b0967a9 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c @@ -440,6 +440,23 @@ static const struct iio_info tcs3472_info = { .attrs = &tcs3472_attribute_group, }; +static int tcs3472_pow...
6bce70d0a9bc907cedb12f498ebc4cd5f7ac7cee
Analyze and fix the following issue in the Linux kernel code: docs: iio: triggered-buffers: use new helpers in example
Problem Details: Update the "typical" triggered buffer example to use various new helpers that have been added in the last year or so. This reflects current expectations of how similar code should be written. Also zero-initialize the buffer so we don't leak stack data. And fix a missing semicolon while we're at it. S...
```diff diff --git a/Documentation/driver-api/iio/triggered-buffers.rst b/Documentation/driver-api/iio/triggered-buffers.rst index 23b82357eba6..23762b06fdc6 100644 --- a/Documentation/driver-api/iio/triggered-buffers.rst +++ b/Documentation/driver-api/iio/triggered-buffers.rst @@ -29,14 +29,14 @@ A typical triggered b...
5bdff291d20c31b365d9ddfe9c426fbfb41da5bb
Analyze and fix the following issue in the Linux kernel code: iio: accel: mma8452: handle I2C read error(s) in mma8452_read()
Problem Details: Currently, If i2c_smbus_read_i2c_block_data() fails but mma8452_set_runtime_pm_state() succeeds, mma8452_read() returns 0. As a result, the caller mma8452_read_raw() assumes the read was successful and proceeds to use a buffer containing uninitialized stack memory. Add proper checking of the I2C read...
```diff diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index 15172ba2972c..cefc7cf4bd83 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -252,6 +252,8 @@ static int mma8452_read(struct mma8452_data *data, __be16 buf[3]) ret = i2c_smbus_read_i2c_block_data(data->c...
97d30982aa5ae2b2f1778fdc91cc8f6e26e15453
Analyze and fix the following issue in the Linux kernel code: iio: dac: ad5504: introduce local dev pointer
Problem Details: Replace &spi->dev with a local dev pointer to shorten lines, fix alignment, and improve overall readability in the probe function. Signed-off-by: Taha Ed-Dafili <0rayn.dev@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
```diff diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c index 03ce37e2c616..5e586185d857 100644 --- a/drivers/iio/dac/ad5504.c +++ b/drivers/iio/dac/ad5504.c @@ -270,25 +270,26 @@ static const struct iio_chan_spec ad5504_channels[] = { static int ad5504_probe(struct spi_device *spi) { - const struc...
947eb6f0a274f8b15a0248051a65b069effd5057
Analyze and fix the following issue in the Linux kernel code: iio: adc: xilinx-ams: fix out-of-bounds channel lookup in event handling
Problem Details: ams_event_to_channel() may return a pointer past the end of dev->channels when no matching scan_index is found. This can lead to invalid memory access in ams_handle_event(). Add a bounds check in ams_event_to_channel() and return NULL when no channel is found. Also guard the caller to safely handle th...
```diff diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c index 124470c92529..6191cd1b29a5 100644 --- a/drivers/iio/adc/xilinx-ams.c +++ b/drivers/iio/adc/xilinx-ams.c @@ -871,6 +871,9 @@ static const struct iio_chan_spec *ams_event_to_channel(struct iio_dev *dev, if (dev->channels[i].scan_ind...
2f856ad3f729e09a1a046272c68437d058c50621
Analyze and fix the following issue in the Linux kernel code: Documentation: iio: fix typo in triggered-buffers example
Problem Details: In the "IIO triggered buffer setup" example, iio_triggered_buffer_setup() is called with "sensor_iio_polfunc" (single 'l') while the function is defined and later referenced as "sensor_iio_pollfunc" (double 'l'). Fix the misspelling so the example is consistent. Signed-off-by: Stepan Ionichev <sozdayv...
```diff diff --git a/Documentation/driver-api/iio/triggered-buffers.rst b/Documentation/driver-api/iio/triggered-buffers.rst index 417555dbbdf4..23b82357eba6 100644 --- a/Documentation/driver-api/iio/triggered-buffers.rst +++ b/Documentation/driver-api/iio/triggered-buffers.rst @@ -43,7 +43,7 @@ A typical triggered buf...
b049fb4081527c8d52834c46cef38c0bb65468ed
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad7192: fix GPOCON register access annotation
Problem Details: The comment next to AD7192_REG_GPOCON marks the register as RO, but the AD7192 datasheet (Rev. A, page 24, GPOCON REGISTER) says: "The GPOCON register is an 8-bit register from which data can be read or to which data can be written." The driver itself uses ad_sd_write_reg() against this register in ad...
```diff diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c index ba27614c89b4..caf4473ad643 100644 --- a/drivers/iio/adc/ad7192.c +++ b/drivers/iio/adc/ad7192.c @@ -39,7 +39,7 @@ #define AD7192_REG_CONF 2 /* Configuration Register (RW, 24-bit) */ #define AD7192_REG_DATA 3 /* Data Register (RO, 2...
a9a00d727b7bbc5e913a919530a9dd468935bf95
Analyze and fix the following issue in the Linux kernel code: iio: magnetometer: ak8975: fix potential kernel stack memory leak
Problem Details: Currently in the AK8975 driver there are four instances where potential uninitialized kernel stack memory leaks can occur. If i2c_smbus_read_i2c_block_data_or_emulated() returns a value less than the size of the buffer, uninitialized bytes are retained in the buffer and later the buffer is passed on to...
```diff diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index 0fb2fd03d11c..bb74abb648f1 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -499,6 +499,10 @@ static int ak8975_who_i_am(const struct ak8975_data *data, dev_err(&client->dev, "Err...
eaead586b3d95890832449f2887283b067426ecc
Analyze and fix the following issue in the Linux kernel code: iio: magnetometer: ak8975: ensure device is awake for buffered capture
Problem Details: Currently, the ak8975_start_read_axis() can be called while the device is autosuspended, causing two issues: 1. I2C transfers in the aforementioned function will fail or timeout because ak8975_runtime_suspend() disables the device regulators. 2. Since ak8975_fill_buffer() does not hold runtime referen...
```diff diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index dbab4d0bba34..0fb2fd03d11c 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -899,6 +899,28 @@ static irqreturn_t ak8975_handle_trigger(int irq, void *p) return IRQ_HANDLED; } +s...
0ce8e3b445a3fec83a023f11512f63ff6da0d460
Analyze and fix the following issue in the Linux kernel code: iio: adc: hx711: move scale computation to per-device storage
Problem Details: The gain-to-scale table is global today, so probe-time scale updates for one device overwrite the values used by any earlier device instance. Fix this by making the gain table const and storing the computed scale values per device in hx711_data. No functional change for single-sensor configurations. ...
```diff diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c index 1db8b68a8f64..86d2a70dd3de 100644 --- a/drivers/iio/adc/hx711.c +++ b/drivers/iio/adc/hx711.c @@ -28,22 +28,20 @@ struct hx711_gain_to_scale { int gain; int gain_pulse; - int scale; int channel; }; /* * .scale depends on A...
d0f23d8a9091f43329e79bcd29bcac6bf81205e5
Analyze and fix the following issue in the Linux kernel code: iio: adc: ti-ads1298: Fix incorrect timeout comment
Problem Details: At the lowest supported data rate of 250Hz, one conversion period is 4ms, not 40ms. The 50ms timeout is deliberately conservative to allow for kernel scheduling latency, which can be significant under load or on slow machines. Fix the comment to state the correct conversion time, use "lowest sample ra...
```diff diff --git a/drivers/iio/adc/ti-ads1298.c b/drivers/iio/adc/ti-ads1298.c index ae30b47e4514..25261163d3e2 100644 --- a/drivers/iio/adc/ti-ads1298.c +++ b/drivers/iio/adc/ti-ads1298.c @@ -210,9 +210,11 @@ static int ads1298_read_one(struct ads1298_private *priv, int chan_index) return ret; } - /* Cannot t...
8e9c394520844fb11404b4f9f16749f90e1d8627
Analyze and fix the following issue in the Linux kernel code: iio: chemical: scd30: reject (response=NULL, size>0) in scd30_i2c_command()
Problem Details: scd30_i2c_command() takes an opaque "response" buffer plus its size. At the start of the function the code already checks if response is NULL (via the rsp local), but the response-decoding loop after the i2c transfer always dereferences rsp without re-checking. With the current callers in scd30_core.c ...
```diff diff --git a/drivers/iio/chemical/scd30_i2c.c b/drivers/iio/chemical/scd30_i2c.c index bf465cc71be7..9e841f565149 100644 --- a/drivers/iio/chemical/scd30_i2c.c +++ b/drivers/iio/chemical/scd30_i2c.c @@ -71,6 +71,9 @@ static int scd30_i2c_command(struct scd30_state *state, enum scd30_cmd cmd, u16 int i, ret; ...
c0b3561c8e4a1a7c03177fa21376c04f554b3a57
Analyze and fix the following issue in the Linux kernel code: iio: magnetometer: ak8975: pass conversion timeouts as arguments
Problem Details: Refactor wait_conversion_complete*_() helper function to accept poll and timeout values directly as parameters. This improves the readability of the code and does not rely on hardcoded macros. Besides that, fix the home grown and obviously wrong in some cases the jiffy-based timeout. Co-developed-by:...
```diff diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index 9511528cdd7b..dcb281149a9d 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -16,6 +16,7 @@ #include <linux/i2c.h> #include <linux/interrupt.h> #include <linux/iopoll.h> +#include ...
acea3560f387a749990567e151e6003ccc249e46
Analyze and fix the following issue in the Linux kernel code: iio: magnetometer: ak8975: fix wrong errno on return
Problem Details: The driver currently returns -EINVAL on polling timeout instead of -ETIMEDOUT. Replace return code for -ETIMEDOUT and remove unnecessary error message as -ETIMEDOUT is a standard POSIX error. Also replace instances of -EINVAL in comments. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.c...
```diff diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index 159c619bd26a..9511528cdd7b 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -662,10 +662,8 @@ static int wait_conversion_complete_gpio(struct ak8975_data *data) break; timeout...
833ca882b76425a7ec12cc8090a390959d0b190f
Analyze and fix the following issue in the Linux kernel code: iio: magnetometer: ak8975: change 'u8*' to 'u8 *' in cast
Problem Details: Change 'u8*' cast to 'u8 *' as the former triggers a checkpatch error. Also fix the indentation of parameters in i2c_smbus_read_i2c_block_data_or_emulated() function. No functional change. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.co...
```diff diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index b15ac73b37ed..159c619bd26a 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -759,9 +759,10 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val) if (ret) ...
e94944d7364d3ddb273539492f9bd9c9a622549a
Analyze and fix the following issue in the Linux kernel code: iio: magnetometer: ak8975: Add missed pm_runtime_put_autosuspend() call
Problem Details: On the failure in the ak8975_read_axis() the PM runtime gets unbalanced. Balance it by calling pm_runtime_put_autosuspend() on error path as well. Fixes: cde4cb5dd422 ("iio: magn: ak8975: deploy runtime and system PM") Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://sashiko.dev/#/patchse...
```diff diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index 44782c26698b..e70101abfcd3 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -784,6 +784,7 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val) exit: mu...
f2c7187e266c16c7a0034731ee468d76c0492644
Analyze and fix the following issue in the Linux kernel code: iio: adxl313: fix typos in documentation
Problem Details: Add missing space in "ADXL313is" and improve grammar for "a single types of channels" to "multiple channels of a single type" as suggested by Jonathan Cameron. Wrap long line as suggested by Andy Shevchenko. Signed-off-by: Wang Zihan <jiyu03@qq.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
```diff diff --git a/Documentation/iio/adxl313.rst b/Documentation/iio/adxl313.rst index 966e72c0109a..cc0829be0447 100644 --- a/Documentation/iio/adxl313.rst +++ b/Documentation/iio/adxl313.rst @@ -11,7 +11,7 @@ This driver supports Analog Device's ADXL313 on SPI/I2C bus. * `ADXL313 <https://www.analog.com/ADXL313>...
8c50a95ceb230d17801758a9e41ffbbbe46f8b4d
Analyze and fix the following issue in the Linux kernel code: iio: light: si1133: prevent race condition on timeout
Problem Details: Sashiko reported a bug where the si1133_command exits on timeout without halting the sensor or masking the interrupt. If the sensor completes the command later, any subsequent command to the sensor will cause the IRQ handler to complete immediately, returning stale data to the driver all while the comm...
```diff diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c index c88c79202be2..bf7bf0f1631d 100644 --- a/drivers/iio/light/si1133.c +++ b/drivers/iio/light/si1133.c @@ -395,8 +395,14 @@ static int si1133_command(struct si1133_data *data, u8 cmd) expected_seq = (data->rsp_seq + 1) & SI1133_MAX_CMD_...
0a5f45ed2342aabae1e32c72558d15be28940a95
Analyze and fix the following issue in the Linux kernel code: iio: light: si1133: reset counter to prevent race condition
Problem Details: Sashiko reported a potential race condition happening when the driver returns an errno after a timeout in the si1133_command() function. The premature exit causes the hardware and software counters to become out of sync by not updating data->rsp_seq, therefore the internal hardware counter keeps increm...
```diff diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c index 44fa152dbd24..c88c79202be2 100644 --- a/drivers/iio/light/si1133.c +++ b/drivers/iio/light/si1133.c @@ -427,6 +427,11 @@ static int si1133_command(struct si1133_data *data, u8 cmd) dev_warn(dev, "Failed to read command 0x%02x, ...
11aa529f27c7c8656ab57a6d79111b2e525f7b19
Analyze and fix the following issue in the Linux kernel code: staging: iio: ad9834: fix chip name typo in comments
Problem Details: Two comments incorrectly refer to 'AD9843' instead of 'AD9834'. Fix the copy-paste typo. Signed-off-by: Angus Gardner <angusg778@gmail.com> Reviewed-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
```diff diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c index 8c0699460ae1..4359b358e0e5 100644 --- a/drivers/staging/iio/frequency/ad9834.c +++ b/drivers/staging/iio/frequency/ad9834.c @@ -167,7 +167,7 @@ static ssize_t ad9834_write(struct device *dev, break; case AD98...
b4e9ede52a6094b4a7fcf584f7348542d0619632
Analyze and fix the following issue in the Linux kernel code: iio: adc: rcar: Fix up Marek Vasut MAINTAINERS entry
Problem Details: Use up to date address. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
```diff diff --git a/MAINTAINERS b/MAINTAINERS index 31c4db07e99b..c316e3b44e19 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22602,7 +22602,7 @@ F: Documentation/devicetree/bindings/mtd/renesas-nandc.yaml F: drivers/mtd/nand/raw/renesas-nand-controller.c RENESAS R-CAR GYROADC DRIVER -M: Marek Vasut <marek.vasut@g...
095ae2f2e72f56d442ec0e476f873fd4d92c81de
Analyze and fix the following issue in the Linux kernel code: iio: temperature: maxim_thermocouple: Fix indentation in of_match table
Problem Details: Replace leading spaces with tabs in the of_device_id table entries to comply with kernel coding style. Signed-off-by: Rahman Mahmutović <mahmutovicrahman5@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
```diff diff --git a/drivers/iio/temperature/maxim_thermocouple.c b/drivers/iio/temperature/maxim_thermocouple.c index 205939680fd4..e898f56d1196 100644 --- a/drivers/iio/temperature/maxim_thermocouple.c +++ b/drivers/iio/temperature/maxim_thermocouple.c @@ -277,8 +277,8 @@ static const struct spi_device_id maxim_therm...
c09f950fd87ad6505cc7bdbac4e0a125b6ed313c
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad7625: fix type mismatch in clamp() macro
Problem Details: clamp() expects compatible operand types. The period calculation uses nanosecond constants, while the local target variable was narrower than the upper bound expression. Make target unsigned long and use unsigned long bounds, including NSEC_PER_USEC for the upper limit. This keeps the operands natural...
```diff diff --git a/drivers/iio/adc/ad7625.c b/drivers/iio/adc/ad7625.c index 0466c0c7eae4..f1ee29f35fa8 100644 --- a/drivers/iio/adc/ad7625.c +++ b/drivers/iio/adc/ad7625.c @@ -175,12 +175,12 @@ enum ad7960_mode { static int ad7625_set_sampling_freq(struct ad7625_state *st, u32 freq) { - u32 target; struct pwm_...
5250b3b1ad99d216b31c98b2b321f1dee362a1b5
Analyze and fix the following issue in the Linux kernel code: arm64: dts: renesas: ironhide: Describe all reserved memory
Problem Details: Fully describe all available DRAM in the DT, and describe regions which are not accessible because they are used by firmware in reserved-memory nodes. Replace the first memory bank memory@60600000 with memory@40000000 and a 518 MiB long reserved-memory no-map subnode. This memory region is used by oth...
```diff diff --git a/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts b/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts index a721734fbd5d..ed027a6c356e 100644 --- a/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts +++ b/arch/arm64/boot/dts/renesas/r8a78000-ironhide.dts @@ -20,10 +20,9 @@ stdout-path = "serial0:...
54613573ff1495b928e2841b257c081a58566901
Analyze and fix the following issue in the Linux kernel code: arm64: dts: renesas: r8a78000: Fix GIC-720AE View 1 Redistributor description
Problem Details: The Renesas R-Car X5H (R8A78000) SoC contains Arm CoreLink GIC-720AE Generic Interrupt Controller with Multi View capability. Firmware has access to configuration View 0, Linux kernel has access to View 1. The Arm CoreLink GIC-720AE Generic Interrupt Controller Technical Reference Manual, currently la...
```diff diff --git a/arch/arm64/boot/dts/renesas/r8a78000.dtsi b/arch/arm64/boot/dts/renesas/r8a78000.dtsi index 5e8fdc818256..d14f0cc0ad36 100644 --- a/arch/arm64/boot/dts/renesas/r8a78000.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a78000.dtsi @@ -694,8 +694,40 @@ #interrupt-cells = <3>; #address-cells = <0>; ...
040eeafee0146b9d046caef501f387e107a59960
Analyze and fix the following issue in the Linux kernel code: firmware: tegra: bpmp: Add support for multi-socket platforms
Problem Details: On multi-socket platforms each socket has its own BPMP that is registered with the kernel, so the existing single fixed "bpmp" debugfs directory name cannot accommodate more than one instance. Group the per-socket BPMP debugfs entries under a shared top-level /sys/kernel/debug/bpmp/ directory, with ea...
```diff diff --git a/drivers/firmware/tegra/bpmp-debugfs.c b/drivers/firmware/tegra/bpmp-debugfs.c index 29037e2b3158..33c6300af964 100644 --- a/drivers/firmware/tegra/bpmp-debugfs.c +++ b/drivers/firmware/tegra/bpmp-debugfs.c @@ -2,6 +2,8 @@ /* * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. */ + ...
b1a58ed9eab146b36f41a55db8f5d7ce9fdedf3f
Analyze and fix the following issue in the Linux kernel code: i2c: core: fix adapter deregistration race
Problem Details: Adapters can be looked up by their id using i2c_get_adapter() which takes a reference to the embedded struct device. Remove the adapter from the IDR before tearing it down during deregistration (and on registration failure) to make sure its resources are not accessed after having been freed (e.g. the ...
```diff diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 01a984d3ca0e..38f425aecef8 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1587,7 +1587,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap) res = device_add(&adap->dev); if (res) { pr_er...
ba14d7cf2fe7284610a29854bdff22b2537d3ce6
Analyze and fix the following issue in the Linux kernel code: i2c: core: fix adapter registration race
Problem Details: Adapters can be looked up based on their id using i2c_get_adapter() which takes a reference to the embedded struct device. Make sure that the adapter (including its struct device) has been initialised before adding it to the IDR to avoid accessing uninitialised data which could, for example, lead to N...
```diff diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index fdf7d7d50f79..01a984d3ca0e 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1580,6 +1580,10 @@ static int i2c_register_adapter(struct i2c_adapter *adap) adap->debugfs = debugfs_create_dir(dev_name(&ada...
3e2041ea586ae37fcea918ecb505ab9972a1201d
Analyze and fix the following issue in the Linux kernel code: i2c: core: disable runtime PM on adapter registration failure
Problem Details: Runtime PM is disabled by driver core when deregistering a device (and on registration failure) but add an explicit disable to balance the enable call when adapter registration fails for symmetry. Fixes: 23a698fe65ec ("i2c: core: treat EPROBE_DEFER when acquiring SCL/SDA GPIOs") Cc: Codrin Ciubotariu ...
```diff diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 25d66de41287..fdf7d7d50f79 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1612,6 +1612,7 @@ out_reg: device_del(&adap->dev); err_remove_debugfs: debugfs_remove_recursive(adap->debugfs); + pm_runtime...
07d5fb537928aad4369aaff0cbae73ba38a719af
Analyze and fix the following issue in the Linux kernel code: i2c: core: fix adapter debugfs creation
Problem Details: Clients can be registered from bus notifier callbacks so the debugfs directory needs to be created before registering the adapter as clients use that directory as their debugfs parent. Move debugfs creation before adapter registration to avoid having clients create their debugfs directories in the deb...
```diff diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 1caaa3b3ee10..25d66de41287 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1557,7 +1557,10 @@ static int i2c_register_adapter(struct i2c_adapter *adap) goto out_list; } - dev_set_name(&adap->dev, "...
158efa411c57111d87bf265a3776614f32d70007
Analyze and fix the following issue in the Linux kernel code: i2c: core: fix adapter probe deferral loop
Problem Details: Drivers must not probe defer after having registered devices as that will trigger a probe loop if the devices bind to a driver (cf. commit fbc35b45f9f6 ("Add documentation on meaning of -EPROBE_DEFER")). Move the recovery initialisation, where the GPIO lookup may fail, before registering the adapter t...
```diff diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index fa9db415e219..1caaa3b3ee10 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1562,6 +1562,10 @@ static int i2c_register_adapter(struct i2c_adapter *adap) adap->dev.type = &i2c_adapter_type; device_initi...
2295d2bb101faa663fbc45fadbb3fec45f107441
Analyze and fix the following issue in the Linux kernel code: i2c: core: fix NULL-deref on adapter registration failure
Problem Details: If adapter registration ever fails the release callback would trigger a NULL-pointer dereference as the completion struct has not been initialised. Note that before the offending commit this would instead have resulted in a minor memory leak of the adapter name. Fixes: 3f8c4f5e9a57 ("i2c: core: fix r...
```diff diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index e42851a10098..fa9db415e219 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1574,8 +1574,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap) res = device_add(&adap->dev); if (res) { pr_er...
3c7e164344e5bcf6f274bbf59a3274f5caad9bc1
Analyze and fix the following issue in the Linux kernel code: i2c: core: fix hang on adapter registration failure
Problem Details: Clients may be registered from bus notifier callbacks when the adapter is registered. On a subsequent error during registration, the adapter references taken by such clients prevent the wait for the references to be released from ever completing. Fix this by refactoring client deregistration and dereg...
```diff diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index abe8341c1d6e..e42851a10098 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -63,6 +63,7 @@ static DEFINE_MUTEX(core_lock); static DEFINE_IDR(i2c_adapter_idr); +static void i2c_deregister_clients(struct ...
8ce19524e4cc2462685f596a6402fbd8fb984ab2
Analyze and fix the following issue in the Linux kernel code: i2c: core: fix irq domain leak on adapter registration failure
Problem Details: Make sure to tear down the host notify irq domain on adapter registration failure to avoid leaking it. This issue was flagged by Sashiko when reviewing another adapter registration fix. Fixes: 4d5538f5882a ("i2c: use an IRQ to report Host Notify events, not alert") Cc: stable@vger.kernel.org # 4.10 C...
```diff diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 9c46147e3506..abe8341c1d6e 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1574,7 +1574,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap) if (res) { pr_err("adapter '%s': can't register ...
e0c121d545134af886b28c4c26d91abf5dd39c17
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: avoid oversized UATS command copy
Problem Details: MCC_ALLOWED_AP_TYPE_CMD exceeds the fixed copied host-command buffer and triggers warnings in the gen2 enqueue path when command 0xc05 is sent. Use IWL_HCMD_DFL_NOCOPY as it was done before the offending commit. Fixes: 078df640ef05 ("wifi: iwlwifi: mld: add support for iwl_mcc_allowed_ap_type_cmd v2"...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index f05df3a3300e..6e507d6dcdd2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause ...
9bf1b409afc7c4a1f0340f3975846c4f3278643a
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mld: send tx power constraints before link activation
Problem Details: TX power constraints must be sent to the firmware before link activation. If not, the firmware will use default power values. Fix this by moving the iwl_mld_send_ap_tx_power_constraint_cmd() call from iwl_mld_start_ap_ibss() to iwl_mld_assign_vif_chanctx(), before iwl_mld_activate_link() for AP interf...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mld/ap.c b/drivers/net/wireless/intel/iwlwifi/mld/ap.c index 5c59acc8c4c5..6598d9333333 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/ap.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/ap.c @@ -9,7 +9,6 @@ #include "ap.h" #include "hcmd.h" #include "tx.h" ...
0eaa1f245ac03ed0c6394159360532726f666811
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: don't support the reset handshake for old firmwares
Problem Details: -77.ucode doesn't contain the fixes for this flow it seems. Don't use the firmware reset handshake even if the firmware claims support for it. Fixes: 906d4eb84408 ("iwlwifi: support firmware reset handshake") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220600 Signed-off-by: Emmanuel Grumbach <...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index ae177477b201..384bed95835d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -1416,6 +1416,12 @@ iwl_op_mode_mvm_start(struct iwl_trans *tr...
46def663dd34da36464ba059f7cfeacf29d98e5e
Analyze and fix the following issue in the Linux kernel code: driver core: remove driver_set_override()
Problem Details: All buses have been converted from driver_set_override() to the generic driver_override infrastructure introduced in commit cb3d1049f4ea ("driver core: generalize driver_override in struct device"). Buses now either opt into the generic sysfs callbacks via the bus_type::driver_override flag, or use de...
```diff diff --git a/drivers/base/driver.c b/drivers/base/driver.c index c5ebf1fdad75..5d9c39081339 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -30,81 +30,6 @@ static struct device *next_device(struct klist_iter *i) return dev; } -/** - * driver_set_override() - Helper to set or clear driver ...
55ced13c42921714e90f8fae94b6ed803330dc6a
Analyze and fix the following issue in the Linux kernel code: rpmsg: use generic driver_override infrastructure
Problem Details: When a driver is probed through __driver_attach(), the bus' match() callback is called without the device lock held, thus accessing the driver_override field without a lock, which can cause a UAF. Fix this by using the driver-core driver_override infrastructure taking care of proper locking internally...
```diff diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 401a4ece0c97..d9d4468e4cbd 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1626,7 +1626,6 @@ static void qcom_glink_rpdev_release(struct device *dev) { struct rpmsg_device *rpde...
331d8900121a1d74ecd45cd2db742ddcb5a0a565
Analyze and fix the following issue in the Linux kernel code: Drivers: hv: vmbus: use generic driver_override infrastructure
Problem Details: When a driver is probed through __driver_attach(), the bus' match() callback is called without the device lock held, thus accessing the driver_override field without a lock, which can cause a UAF. Fix this by using the driver-core driver_override infrastructure taking care of proper locking internally...
```diff diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index d28ff45d4cfd..acfb579828c5 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -538,34 +538,6 @@ static ssize_t device_show(struct device *dev, } static DEVICE_ATTR_RO(device); -static ssize_t driver_override_store(struct dev...
d541aa1897f67f4f14c805785bff894bcc61dca1
Analyze and fix the following issue in the Linux kernel code: cdx: use generic driver_override infrastructure
Problem Details: When a driver is probed through __driver_attach(), the bus' match() callback is called without the device lock held, thus accessing the driver_override field without a lock, which can cause a UAF. Fix this by using the driver-core driver_override infrastructure taking care of proper locking internally...
```diff diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c index 9196dc50a48d..d3d230247262 100644 --- a/drivers/cdx/cdx.c +++ b/drivers/cdx/cdx.c @@ -156,8 +156,6 @@ static int cdx_unregister_device(struct device *dev, } else { cdx_destroy_res_attr(cdx_dev, MAX_CDX_DEV_RESOURCES); debugfs_remove_recursive(cdx_...
1947229f5f2a8d4ecf8c971aca68a1242bb7b37c
Analyze and fix the following issue in the Linux kernel code: amba: use generic driver_override infrastructure
Problem Details: When a driver is probed through __driver_attach(), the bus' match() callback is called without the device lock held, thus accessing the driver_override field without a lock, which can cause a UAF. Fix this by using the driver-core driver_override infrastructure taking care of proper locking internally...
```diff diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 6d479caf89cb..d721d64a9858 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -82,33 +82,6 @@ static void amba_put_disable_pclk(struct amba_device *pcdev) } -static ssize_t driver_override_show(struct device *_dev, - struct device_a...
e11560b050ce867bd7d3ccea138231db54e2250a
Analyze and fix the following issue in the Linux kernel code: clk: samsung: exynos990: Fix PERIC0/1 USI clock types
Problem Details: Use nMUX() for USI and UART user muxes to allow reparenting between OSC and CMU IP output when changing rates, and use DIV_F() with CLK_SET_RATE_PARENT on their dividers and gates so rate requests propagate upward. Consolidate identical USI parent arrays into shared mout_peric0_nonbususer_p and mout_p...
```diff diff --git a/drivers/clk/samsung/clk-exynos990.c b/drivers/clk/samsung/clk-exynos990.c index 6277dd557fab..4385c3b76dd6 100644 --- a/drivers/clk/samsung/clk-exynos990.c +++ b/drivers/clk/samsung/clk-exynos990.c @@ -1546,54 +1546,44 @@ static const unsigned long peric0_clk_regs[] __initconst = { /* Parent clo...
171022c7d594c133a45f92357a2a91475edabe20
Analyze and fix the following issue in the Linux kernel code: media: rc: igorplugusb: fix control request setup packet
Problem Details: Commit eac69475b01f ("media: rc: igorplugusb: heed coherency rules") changed the control request storage from an embedded struct to an allocated pointer so it can obey DMA coherency rules. However, the driver still passes &ir->request to usb_fill_control_urb(). That points the URB setup packet at the ...
```diff diff --git a/drivers/media/rc/igorplugusb.c b/drivers/media/rc/igorplugusb.c index 3e10f6fe89f8..b5117ee9f5fa 100644 --- a/drivers/media/rc/igorplugusb.c +++ b/drivers/media/rc/igorplugusb.c @@ -184,7 +184,7 @@ static int igorplugusb_probe(struct usb_interface *intf, if (!ir->buf_in) goto fail; usb_fill_...
85e0f27dd1396307913ffc5745b0c05137e9beac
Analyze and fix the following issue in the Linux kernel code: tracing/probes: Point the error offset correctly for eprobe argument error
Problem Details: Fix to point the error offset correctly for eprobe argument error. In the cleanup commit 1b8b0cd754cd ("tracing/probes: Move event parameter fetching code to common parser"), due to incorrect backward compatibility aimed at conforming to the test specifications, the error location was set to 0 when a n...
```diff diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c index e0d3a0da26af..44c22d4e7881 100644 --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c @@ -962,8 +962,6 @@ static int parse_probe_vars(char *orig_arg, const struct fetch_type *t, code->op = FETCH_OP_COMM; return 0; ...
285ecb7d9e1b2401c2eccca4d0f26615f4d651eb
Analyze and fix the following issue in the Linux kernel code: Revert "gpib: cb7210: Fix region leak when request_irq fails"
Problem Details: This reverts commit 5ad28496055858166eb2268344c8fda2c26d3561. Turns out not to be correct. Link: https://lore.kernel.org/r/PpNUbGhrvT8I_KayoDvQYI2PYjmMw1QEkuVBDZz2PwBsVVgPkBXJarc2mBM0IhiH3AQG0GtgqEsDRXNj3yUKEDBaZa25u73pAjvcE6vfRsg=@protonmail.com Reported-by: Dominik Karol Piątkowski <dominik.karol.p...
```diff diff --git a/drivers/gpib/cb7210/cb7210.c b/drivers/gpib/cb7210/cb7210.c index 05058bf2cd50..6dd8637c5964 100644 --- a/drivers/gpib/cb7210/cb7210.c +++ b/drivers/gpib/cb7210/cb7210.c @@ -1062,7 +1062,6 @@ static int cb_isa_attach(struct gpib_board *board, const struct gpib_board_confi // install interrupt han...
05d5d79440c2cc0784f91b61f2012753e66be472
Analyze and fix the following issue in the Linux kernel code: Revert "gpib: cb7210: Fix region leak when request_irq fails"
Problem Details: This reverts commit 2eae90a457baa0048a96ed38ad93090ee38c8b2f. Turns out not to be correct. Link: https://lore.kernel.org/r/PpNUbGhrvT8I_KayoDvQYI2PYjmMw1QEkuVBDZz2PwBsVVgPkBXJarc2mBM0IhiH3AQG0GtgqEsDRXNj3yUKEDBaZa25u73pAjvcE6vfRsg=@protonmail.com Reported-by: Dominik Karol Piątkowski <dominik.karol.p...
```diff diff --git a/drivers/gpib/cb7210/cb7210.c b/drivers/gpib/cb7210/cb7210.c index 673b5bfe2e7d..6dd8637c5964 100644 --- a/drivers/gpib/cb7210/cb7210.c +++ b/drivers/gpib/cb7210/cb7210.c @@ -1049,8 +1049,7 @@ static int cb_isa_attach(struct gpib_board *board, const struct gpib_board_confi if (!request_region(conf...
7c6535c37dbc03c1c35926b7420d66fb122b513a
Analyze and fix the following issue in the Linux kernel code: s390: Implement _THIS_IP_ using inline asm
Problem Details: Both GCC [1] and Clang [2] consider the generic version of _THIS_IP_ to be broken: #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) In particular, the address of a label is only expected to be used with a computed goto. While the generic version more or less works ...
```diff diff --git a/arch/s390/include/asm/linkage.h b/arch/s390/include/asm/linkage.h index df3fb7d8227b..1b3ac553a642 100644 --- a/arch/s390/include/asm/linkage.h +++ b/arch/s390/include/asm/linkage.h @@ -7,4 +7,6 @@ #define __ALIGN .balign CONFIG_FUNCTION_ALIGNMENT, 0x07 #define __ALIGN_STR __stringify(__ALIGN) ...
d1c9f40f764ed2a91d2903c25d1962cf43afef89
Analyze and fix the following issue in the Linux kernel code: media: iris: optimize COMV buffer allocation for VPU3x and VPU4x
Problem Details: The existing iris_vpu_dec_comv_size() used VIDEO_MAX_FRAME (32) as num_comv count unconditionally when calculating the co-located motion vector (COMV) buffer size. This resulted in an oversized COMV buffer allocation throughout decode session, wasting memory regardless of actual number of buffers requi...
```diff diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c index c90b22a75bc5..7ac69af63ead 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -10,7 +10,6 @@...
45ac2230f929b9f0fae899c4a5c6bf763250fc13
Analyze and fix the following issue in the Linux kernel code: media: iris: Fix use IRQF_NO_AUTOEN when requesting the IRQ
Problem Details: Requesting the IRQ and then immediately disabling it is fragile as it leaves a window when the IRQ is still enabled although the underlying device might be not completely setup for IRQ handling. Pass IRQF_NO_AUTOEN instead of calling disable_irq_nosync(). Fixes: fb583a214337 ("media: iris: introduce h...
```diff diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c index d36f0c0e785b..a755a6f73ea6 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -259,12 +259,12 @@ static int iris_probe(struct platform_d...
c53e0550288b2e08b984b24035c471941b7820c7
Analyze and fix the following issue in the Linux kernel code: media: qcom: venus: relax encoder frame/blur step size on v6
Problem Details: Encoder HFI capabilities on v6 enforce a 16-pixel step for frame and blur dimensions, which does not reflect actual hardware requirements and can reject valid userspace configurations. Relax the step size to 1 while leaving min/max limits unchanged. Fixes: 869d77e706290 ("media: venus: hfi_plat_v6: P...
```diff diff --git a/drivers/media/platform/qcom/venus/hfi_platform_v6.c b/drivers/media/platform/qcom/venus/hfi_platform_v6.c index d8568c08cc36..fb8d10ab3404 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_platform_v6.c @@ -173,8 +173,8 @@ static const stru...
35428ae3a6a40912f1f7b47bb6c65f1a63d0b8f8
Analyze and fix the following issue in the Linux kernel code: media: qcom: venus: relax encoder frame/blur dimension steps on v4
Problem Details: Encoder HFI capabilities on v4 advertise a 16-pixel step for frame and blur dimensions. This is overly restrictive and can cause userspace caps negotiation to fail even for valid resolutions. Relax the advertised step size to 1 and keep alignment enforcement in buffer layout and size calculations. Fi...
```diff diff --git a/drivers/media/platform/qcom/venus/hfi_platform_v4.c b/drivers/media/platform/qcom/venus/hfi_platform_v4.c index cda888b56b5d..e0b3652bb440 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform_v4.c +++ b/drivers/media/platform/qcom/venus/hfi_platform_v4.c @@ -136,8 +136,8 @@ static const stru...
e1c9adabb268cc5d56723b7df1da49e59070f309
Analyze and fix the following issue in the Linux kernel code: media: qcom: venus: drop extra padding in NV12 raw size calculation
Problem Details: get_framesize_raw_nv12() currently adds SZ_4K to the UV plane size and an additional SZ_8K to the total buffer size. This inflates the calculated sizeimage and leads userspace to over-allocate buffers without a clear requirement. Remove the extra SZ_4K/SZ_8K padding and compute the NV12 size as the su...
```diff diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 747c388fe25f..59eee3dd9e06 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -954,8 +954,8 @@ static u32 get_framesize_raw_nv12(u32 width, u32 ...
3eb9ba0da0ab73e135f93ffccf07381ba11f100e
Analyze and fix the following issue in the Linux kernel code: Revert "media: venus: hfi_platform: Correct supported codecs for sc7280"
Problem Details: This reverts commit c0ab2901fc68 ("media: venus: hfi_platform: Correct supported codecs for sc7280"). The codecs might be deprecated, but they still work (somewhat) perfectly and don't cause any issues with the rest of the system. Reenable VP8 codecs by reverting the offending commit. Tested with flus...
```diff diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index 92765f9c8873..c4cf6cd50a9a 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -268,7 +268,6 @@ static int hfi_platform_parser(struct...
ac35b5580ace12e5d0a0b5e61e36d2c4e1ffa29c
Analyze and fix the following issue in the Linux kernel code: rust: arm64: set uwtable llvm module flag for CONFIG_UNWIND_TABLES
Problem Details: Due to a rustc bug [1] the -Cforce-unwind-tables=y flag only emits the uwtable annotation for functions, but not for the module. This means that compiler-generated functions such as 'asan.module_ctor' do not receive the uwtable annotation. When CONFIG_UNWIND_PATCH_PAC_INTO_SCS is enabled, this leads t...
```diff diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 73a10f65ce8b..6b005c8fef70 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -63,6 +63,9 @@ else KBUILD_CFLAGS += -fasynchronous-unwind-tables KBUILD_AFLAGS += -fasynchronous-unwind-tables KBUILD_RUSTFLAGS += -Cforce-unwind-tables=y -Zu...
8070a50b88971f9fada55a3ae3330f529bef9adc
Analyze and fix the following issue in the Linux kernel code: xfs: abort mount if xfs_fs_reserve_ag_blocks fails
Problem Details: xfs_mountfs currently ignores all errors from xfs_fs_reserve_ag_blocks, which can lead to the mount path continuing on corruption errors. Fix the check to only ignore -ENOSPC as in other callers, and unwind for all other errors. Fixes: 81ed94751b15 ("xfs: fix log intent recovery ENOSPC shutdowns when ...
```diff diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index b24195f570cd..7aa51826b1ca 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1149,9 +1149,12 @@ xfs_mountfs( * blocks. */ error = xfs_fs_reserve_ag_blocks(mp); - if (error && error == -ENOSPC) + if (error) { + if (error != -ENOSPC) +...
c316bb56bf4dda9bd3456a163c3a3856ca1b9498
Analyze and fix the following issue in the Linux kernel code: xfs: drop the RTG reference later in xfs_ioc_rtgroup_geometry
Problem Details: Keep the rtgroup reference until after reporting the write pointer, as that uses it. Right now this is not a major issue as we don't support shrinking file systems in a way that makes RTGs go away, but let's stick to the proper reference counting to prepare for that. Fixes: c6ce65cb17aa ("xfs: add wr...
```diff diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 46e234863644..737afcb5652a 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -433,9 +433,8 @@ xfs_ioc_rtgroup_geometry( return -EINVAL; error = xfs_rtgroup_get_geometry(rtg, &rgeo); - xfs_rtgroup_put(rtg); if (error) - return error; ...
c3e073894379532c00cca7ba5762e18fafe29da8
Analyze and fix the following issue in the Linux kernel code: xfs: fix rtgroup cleanup in CoW fork repair
Problem Details: xrep_cow_find_bad_rt() initializes scrub rtgroup state before the force-rebuild path calls xrep_cow_mark_file_range(). If that call fails, the code jumps directly to out_rtg, which skips the scrub rtgroup cleanup and only drops the local rtgroup reference. Remove the unnecessary jump so the function f...
```diff diff --git a/fs/xfs/scrub/cow_repair.c b/fs/xfs/scrub/cow_repair.c index a6ff09ace43d..c25716fc4fee 100644 --- a/fs/xfs/scrub/cow_repair.c +++ b/fs/xfs/scrub/cow_repair.c @@ -382,12 +382,9 @@ xrep_cow_find_bad_rt( * CoW fork and then scan for staging extents in the refcountbt. */ if ((sc->sm->sm_flags &...
fcf4faba9f986b3bb528da11913c9ec5d6e8f689
Analyze and fix the following issue in the Linux kernel code: xfs: fix error returns in CoW fork repair
Problem Details: xrep_cow_find_bad() returns success after the cleanup labels even if AG setup, btree queries, or bitmap updates failed. This can make repair continue with an incomplete bad-file-offset bitmap instead of stopping at the original error. The force-rebuild path has a related cleanup problem. If xrep_cow_m...
```diff diff --git a/fs/xfs/scrub/cow_repair.c b/fs/xfs/scrub/cow_repair.c index bffc4666ce60..a6ff09ace43d 100644 --- a/fs/xfs/scrub/cow_repair.c +++ b/fs/xfs/scrub/cow_repair.c @@ -300,18 +300,15 @@ xrep_cow_find_bad( * on the debugging knob, replace everything in the CoW fork. */ if ((sc->sm->sm_flags & XFS_...
36ca6f11424a5b6d92b88df37c40bf2fe825d5a0
Analyze and fix the following issue in the Linux kernel code: xfs: fix overlapping extents returned for pNFS LAYOUTGET
Problem Details: xfs_fs_map_blocks() currently passes XFS_BMAPI_ENTIRE to xfs_bmapi_read(), which causes the bmap code to expand the mapping to cover the entire extent rather than the requested range. A single LAYOUTGET request from the client can cause the server to issue multiple calls to xfs_fs_map_blocks() for dif...
```diff diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c index b792e066b403..d92993367ab6 100644 --- a/fs/xfs/xfs_pnfs.c +++ b/fs/xfs/xfs_pnfs.c @@ -118,7 +118,6 @@ xfs_fs_map_blocks( struct xfs_bmbt_irec imap; xfs_fileoff_t offset_fsb, end_fsb; loff_t limit; - int bmapi_flags = XFS_BMAPI_ENTIRE; int n...
97bdbf2613eb89428b739ce09d1a6e1c8435a286
Analyze and fix the following issue in the Linux kernel code: xfs: fix use of uninitialized imap in xfs_fs_map_blocks error path
Problem Details: xfs_fs_map_blocks() acquires the data map lock and then calls xfs_bmapi_read(). If xfs_bmapi_read() fails, the function currently still falls through to xfs_bmbt_to_iomap(), which consumes an uninitialized imap record and may return invalid data to the caller. Fix this by releasing the data map lock a...
```diff diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c index 221e55887a2a..b792e066b403 100644 --- a/fs/xfs/xfs_pnfs.c +++ b/fs/xfs/xfs_pnfs.c @@ -174,12 +174,15 @@ xfs_fs_map_blocks( lock_flags = xfs_ilock_data_map_shared(ip); error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap, &nimaps, bm...
bc95fa240a1b8ae64d3dabe87cbe103b912afc45
Analyze and fix the following issue in the Linux kernel code: xfs: handle racing deletions in xfs_zone_gc_iter_irec
Problem Details: Under heavy garbage collection pressure from RocksDB workloads, filesystem shutdowns can occur in xfs_zone_gc_iter_irec when xfs_iget() returns -EINVAL for deleted files. Fix this by handling -EINVAL just like we handle -ENOENT, allowing zone GC to safely ignore stale mappings. Fixes: 080d01c41d44 ("...
```diff diff --git a/fs/xfs/xfs_zone_gc.c b/fs/xfs/xfs_zone_gc.c index c8a1d5c0332c..f03211e4354a 100644 --- a/fs/xfs/xfs_zone_gc.c +++ b/fs/xfs/xfs_zone_gc.c @@ -400,7 +400,7 @@ retry: /* * If the inode was already deleted, skip over it. */ - if (error == -ENOENT) { + if (error == -ENOENT || error == -EIN...
96c377e999737cddbfbf1de975b5285fa047c4bc
Analyze and fix the following issue in the Linux kernel code: gpu: nova-core: send UNLOADING_GUEST_DRIVER GSP command upon unloading
Problem Details: Currently, the GSP is left running after the driver is unbound. This is not great for several reasons, notably that it can still access shared memory areas that the kernel will now reclaim (especially problematic on setups without an IOMMU). Fix this by sending the `UNLOADING_GUEST_DRIVER` GSP command...
```diff diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs index cf134cab49cd..011d504830e4 100644 --- a/drivers/gpu/nova-core/gpu.rs +++ b/drivers/gpu/nova-core/gpu.rs @@ -243,8 +243,10 @@ impl fmt::Display for Spec { } /// Structure holding the resources required to operate the GPU. -#[pin_d...
3ea695eb111fc5a7ffddd21d5c3fee6d82560413
Analyze and fix the following issue in the Linux kernel code: dts: riscv: spacemit: k3: Fix I/O power settings
Problem Details: SpacemiT K3 SoC support dual-voltage I/O power domain, while initially configure to 3.3v, and need to access register from APBC space to switch to 1.8v domain. Fix the GMAC0's I/O pins 1.8v switch failure that will result a broken ethernet driver. Fixes: d8944577496b ("riscv: dts: spacemit: k3: add p...
```diff diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi index 223e66721bf9..19fc9b49668e 100644 --- a/arch/riscv/boot/dts/spacemit/k3.dtsi +++ b/arch/riscv/boot/dts/spacemit/k3.dtsi @@ -1065,6 +1065,7 @@ clocks = <&syscon_apbc CLK_APBC_AIB>, <&syscon_apbc CLK_APBC_AIB_...
bb4832101b0969d7d3faf7dd6095274db288cd0f
Analyze and fix the following issue in the Linux kernel code: perf annotate: Fix missing branch counter column in TUI mode
Problem Details: 'perf annotate' checks that evlist->nr_br_cntr has been incremented to determine whether to show branch counter information. However, this data is not populated until after the check when events are processed. Therefore, this counter will always be less than zero and the Branch Count column is never ...
```diff diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 719b36d4eed5..5f450c8093c0 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -559,6 +559,10 @@ static int __cmd_annotate(struct perf_annotate *ann) if (ret) goto out; + if ((use_browser == 1 |...
6539aef6347ee57301c7e47a518bbc9403dba6fa
Analyze and fix the following issue in the Linux kernel code: perf script: Fix missing '+' indicator when branch counter reaches upper limit
Problem Details: When displaying branch counter (br_cntr) information, a "+" suffix represents that event occurrences may have been lost due to branch counter saturation. However, this indicator was missing in perf script. Add it back. Before: # Branch counter abbr list: # cpu_core/event=0xc4,umask=0x20/ppp = A # ...
```diff diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index e330ae7f725e..5124edf2b7a6 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1291,8 +1291,12 @@ static int ip__fprintf_jump(uint64_t ip, struct branch_entry *en, if (!verbose) { for (j = 0; j < num...
83eff458a690e650b68cd6467aae8959755c5388
Analyze and fix the following issue in the Linux kernel code: perf arm-spe: Don't warn about the discard bit if it doesn't exist
Problem Details: Opening an SPE event shows a warning that doesn't concern the user: $ perf record -e arm_spe Unknown/empty format name: discard Perf only wants to know if the discard bit is set for configuring the event, not in response to anything the user has done. Fix it by adding another helper that returns ...
```diff diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c index f00d72d087fc..91bb28cad79a 100644 --- a/tools/perf/arch/arm64/util/arm-spe.c +++ b/tools/perf/arch/arm64/util/arm-spe.c @@ -428,7 +428,8 @@ static int arm_spe_recording_options(struct auxtrace_record *itr, evlist__f...
167bef4df68635f8bfa2af9108351ee78536d7fb
Analyze and fix the following issue in the Linux kernel code: perf util: Fix perf_exe() buffer write past end
Problem Details: perf_exe() passes len to readlink() and then unconditionally writes a trailing NUL at buf[n]. If readlink() returns len, the write lands one byte past the buffer. Read at most len - 1 bytes and keep the existing NUL termination. Also guard the fallback path for tiny buffers so copying "perf" cannot ov...
```diff diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 25849434f0a4..2c2a5c449ffd 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -419,11 +419,21 @@ out: char *perf_exe(char *buf, int len) { - int n = readlink("/proc/self/exe", buf, len); + int n; + + if (len <= 0) + return ...