id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
a46d0ea5c94205f40ecf912d1bb7806a8a64704f
Analyze and fix the following issue in the Linux kernel code: tcp: count CLOSE-WAIT sockets for TCP_MIB_CURRESTAB
Problem Details: According to RFC 1213, we should also take CLOSE-WAIT sockets into consideration: "tcpCurrEstab OBJECT-TYPE ... The number of TCP connections for which the current state is either ESTABLISHED or CLOSE- WAIT." After this, CurrEstab counter will display the total number of ESTABLISHED and CL...
```diff diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 4d8cc2ebb64c..e6790ea74877 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2649,6 +2649,10 @@ void tcp_set_state(struct sock *sk, int state) if (oldstate != TCP_ESTABLISHED) TCP_INC_STATS(sock_net(sk), TCP_MIB_CURRESTAB); break; + case TCP_CLOSE_...
b907194a5d5bcd3b01d28d095f6a4d9fcd9c5354
Analyze and fix the following issue in the Linux kernel code: octeontx2-af: Add debugfs support to dump NIX TM topology
Problem Details: This patch adds support to dump NIX transmit queue topology. There are multiple levels of scheduling/shaping supported by NIX and a packet traverses through multiple levels before sending the packet out. At each level, there are set of scheduling/shaping rules applied to a packet flow. Each packet tra...
```diff diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h index 35834687e40f..3063a84a45ef 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h @@ -76,6 +76,7 @@ struct rvu_debugfs { struct dump_...
db574f2f96d0c9a245a9e787e3d9ec288fb2b445
Analyze and fix the following issue in the Linux kernel code: KVM: x86/mmu: Don't save mmu_invalidate_seq after checking private attr
Problem Details: Drop the second snapshot of mmu_invalidate_seq in kvm_faultin_pfn(). Before checking the mismatch of private vs. shared, mmu_invalidate_seq is saved to fault->mmu_seq, which can be used to detect an invalidation related to the gfn occurred, i.e. KVM will not install a mapping in page table if fault->mm...
```diff diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index b7b4426a7221..8d74bdef68c1 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -4411,9 +4411,6 @@ static int kvm_faultin_pfn(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault, return RET_PF_EMULATE; } - fault->mmu_seq =...
14951beaec93696b092a906baa0f29322cf34004
Analyze and fix the following issue in the Linux kernel code: arm64: armv8_deprecated: Fix warning in isndep cpuhp starting process
Problem Details: The function run_all_insn_set_hw_mode() is registered as startup callback of 'CPUHP_AP_ARM64_ISNDEP_STARTING', it invokes set_hw_mode() methods of all emulated instructions. As the STARTING callbacks are not expected to fail, if one of the set_hw_mode() fails, e.g. due to el0 mixed-endian is not suppo...
```diff diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c index dd6ce86d4332..b776e7424fe9 100644 --- a/arch/arm64/kernel/armv8_deprecated.c +++ b/arch/arm64/kernel/armv8_deprecated.c @@ -462,6 +462,9 @@ static int run_all_insn_set_hw_mode(unsigned int cpu) for (int i = 0; i < A...
712115a24b1a5318c10fc757d48d8f33815a6bfa
Analyze and fix the following issue in the Linux kernel code: selftests: hsr: add missing config for CONFIG_BRIDGE
Problem Details: hsr_redbox.sh test need to create bridge for testing. Add the missing config CONFIG_BRIDGE in config file. Fixes: eafbf0574e05 ("test: hsr: Extend the hsr_redbox.sh to have more SAN devices connected") Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Tested-by: Simon Horman <horms@kernel.org> Reviewe...
```diff diff --git a/tools/testing/selftests/net/hsr/config b/tools/testing/selftests/net/hsr/config index 22061204fb69..241542441c51 100644 --- a/tools/testing/selftests/net/hsr/config +++ b/tools/testing/selftests/net/hsr/config @@ -2,3 +2,4 @@ CONFIG_IPV6=y CONFIG_NET_SCH_NETEM=m CONFIG_HSR=y CONFIG_VETH=y +CONFI...
1cd4bc987abb2823836cbb8f887026011ccddc8a
Analyze and fix the following issue in the Linux kernel code: vxlan: Fix regression when dropping packets due to invalid src addresses
Problem Details: Commit f58f45c1e5b9 ("vxlan: drop packets from invalid src-address") has recently been added to vxlan mainly in the context of source address snooping/learning so that when it is enabled, an entry in the FDB is not being created for an invalid address for the corresponding tunnel endpoint. Before comm...
```diff diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index f78dd0438843..567cb3faab70 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -1446,6 +1446,10 @@ static bool vxlan_snoop(struct net_device *dev, struct vxlan_fdb *f; u32 ifindex = 0; + /* I...
affc18fdc694190ca7575b9a86632a73b9fe043d
Analyze and fix the following issue in the Linux kernel code: net: sched: sch_multiq: fix possible OOB write in multiq_tune()
Problem Details: q->bands will be assigned to qopt->bands to execute subsequent code logic after kmalloc. So the old q->bands should not be used in kmalloc. Otherwise, an out-of-bounds write will occur. Fixes: c2999f7fb05b ("net: sched: multiq: don't call qdisc_put() while holding tree lock") Signed-off-by: Hangyu Hua...
```diff diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c index 79e93a19d5fa..06e03f5cd7ce 100644 --- a/net/sched/sch_multiq.c +++ b/net/sched/sch_multiq.c @@ -185,7 +185,7 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt, qopt->bands = qdisc_dev(sch)->real_num_tx_queues; - removed = kma...
491aee894a08bc9b8bb52e7363b9d4bc6403f363
Analyze and fix the following issue in the Linux kernel code: ionic: fix kernel panic in XDP_TX action
Problem Details: In the XDP_TX path, ionic driver sends a packet to the TX path with rx page and corresponding dma address. After tx is done, ionic_tx_clean() frees that page. But RX ring buffer isn't reset to NULL. So, it uses a freed page, which causes kernel panic. BUG: unable to handle page fault for address: ffff...
```diff diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index 5dba6d2d633c..2427610f4306 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -586,6 +586,7 @@ static bool ionic_run_xdp(str...
310ec03841a36e3f45fb528f0dfdfe5b9e84b037
Analyze and fix the following issue in the Linux kernel code: dma-buf: align fd_flags and heap_flags with dma_heap_allocation_data
Problem Details: dma_heap_allocation_data defines the UAPI as follows: struct dma_heap_allocation_data { __u64 len; __u32 fd; __u32 fd_flags; __u64 heap_flags; }; However, dma_heap_buffer_alloc() casts both fd_flags and heap_flags into unsigned int. We're inconsistent with types in the non UAPI arguments. T...
```diff diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index 84ae708fafe7..2298ca5e112e 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -50,8 +50,8 @@ static struct class *dma_heap_class; static DEFINE_XARRAY_ALLOC(dma_heap_minors); static int dma_heap_buffer_alloc(...
61578f67937881abf54c8bd258eb913312dbe4c1
Analyze and fix the following issue in the Linux kernel code: net: phy: aquantia: add support for PHY LEDs
Problem Details: Aquantia Ethernet PHYs got 3 LED output pins which are typically used to indicate link status and activity. Add a minimal LED controller driver supporting the most common uses with the 'netdev' trigger as well as software-driven forced control of the LEDs. Signed-off-by: Daniel Golle <daniel@makrotopi...
```diff diff --git a/drivers/net/phy/aquantia/Makefile b/drivers/net/phy/aquantia/Makefile index aa77fb63c8ec..c6c4d494ee2a 100644 --- a/drivers/net/phy/aquantia/Makefile +++ b/drivers/net/phy/aquantia/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -aquantia-objs += aquantia_main.o aquantia_firmware.o +...
cdbdb3c62af5bc13e6e8a9310470c71c33340d26
Analyze and fix the following issue in the Linux kernel code: net: bridge: fix an inconsistent indentation
Problem Details: Smatch complains: net/bridge/br_netlink_tunnel.c: 318 br_process_vlan_tunnel_info() warn: inconsistent indenting Fix it with a proper indenting Signed-off-by: Chen Hanxiao <chenhx.fnst@fujitsu.com> Acked-by: Nikolay Aleksandrov <razor@blackwall.org> Signed-off-by: David S. Miller <davem@davemloft....
```diff diff --git a/net/bridge/br_netlink_tunnel.c b/net/bridge/br_netlink_tunnel.c index 17abf092f7ca..71a12da30004 100644 --- a/net/bridge/br_netlink_tunnel.c +++ b/net/bridge/br_netlink_tunnel.c @@ -315,8 +315,8 @@ int br_process_vlan_tunnel_info(const struct net_bridge *br, if (curr_change) *changed = c...
0a8d3f2e3e8d8aea8af017e14227b91d5989b696
Analyze and fix the following issue in the Linux kernel code: net: phy: Micrel KSZ8061: fix errata solution not taking effect problem
Problem Details: KSZ8061 needs to write to a MMD register at driver initialization to fix an errata. This worked in 5.0 kernel but not in newer kernels. The issue is the main phylib code no longer resets PHY at the very beginning. Calling phy resuming code later will reset the chip if it is already powered down at th...
```diff diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 8c20cf937530..5aada7cf3da7 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -866,6 +866,17 @@ static int ksz8061_config_init(struct phy_device *phydev) { int ret; + /* Chip can be powered down by the bootstrap cod...
fb0aa0781a5f457e3864da68af52c3b1f4f7fd8f
Analyze and fix the following issue in the Linux kernel code: net/smc: avoid overwriting when adjusting sock bufsizes
Problem Details: When copying smc settings to clcsock, avoid setting clcsock's sk_sndbuf to sysctl_tcp_wmem[1], since this may overwrite the value set by tcp_sndbuf_expand() in TCP connection establishment. And the other setting sk_{snd|rcv}buf to sysctl value in smc_adjust_sock_bufsizes() can also be omitted since th...
```diff diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index e50a286fd0fb..c5f98c6b2561 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -459,29 +459,11 @@ out: static void smc_adjust_sock_bufsizes(struct sock *nsk, struct sock *osk, unsigned long mask) { - struct net *nnet = sock_net(nsk); - nsk...
8b0f7410942cdc420c4557eda02bfcdf60ccec17
Analyze and fix the following issue in the Linux kernel code: octeontx2-af: Always allocate PF entries from low prioriy zone
Problem Details: PF mcam entries has to be at low priority always so that VF can install longest prefix match rules at higher priority. This was taken care currently but when priority allocation wrt reference entry is requested then entries are allocated from mid-zone instead of low priority zone. Fix this and always a...
```diff diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index e8b73b9d75e3..97722ce8c4cb 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -2519,7 +2519,17 @@ static int npc...
4306c047415a227bc72f0e7ba9bde1ccdac10435
Analyze and fix the following issue in the Linux kernel code: ARM: dts: stm32: Add arm,no-tick-in-suspend to STM32MP15xx STGEN timer
Problem Details: STM32MP15xx RM0436 Rev 6 section 46.3 System timer generator (STGEN) states " Arm recommends that the system counter is in an always-on power domain. This is not supported in the current implementation, therefore STGEN should be saved and restored before Standby mode entry, and restored at Standby exit...
```diff diff --git a/arch/arm/boot/dts/st/stm32mp151.dtsi b/arch/arm/boot/dts/st/stm32mp151.dtsi index 90c5c72c87ab..4f878ec102c1 100644 --- a/arch/arm/boot/dts/st/stm32mp151.dtsi +++ b/arch/arm/boot/dts/st/stm32mp151.dtsi @@ -50,6 +50,7 @@ <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>, <...
8832fc1e502687869606bb0a7b79848ed3bf036f
Analyze and fix the following issue in the Linux kernel code: udf: Fix lock ordering in udf_evict_inode()
Problem Details: udf_evict_inode() calls udf_setsize() to truncate deleted inode. However inode deletion through udf_evict_inode() can happen from inode reclaim context and udf_setsize() grabs mapping->invalidate_lock which isn't generally safe to acquire from fs reclaim context since we allocate pages under mapping->i...
```diff diff --git a/fs/udf/file.c b/fs/udf/file.c index 97c59585208c..3a4179de316b 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c @@ -232,7 +232,9 @@ static int udf_setattr(struct mnt_idmap *idmap, struct dentry *dentry, if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size != i_size_read(inode)) { + filemap_in...
03fceb8dbd09923f271271a438da049f75eb9c10
Analyze and fix the following issue in the Linux kernel code: isofs: add missing MODULE_DESCRIPTION()
Problem Details: Fix the 'make W=1' warning: WARNING: modpost: missing MODULE_DESCRIPTION() in fs/isofs/isofs.o Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Jan Kara <jack@suse.cz> Message-Id: <20240526-md-fs-isofs-v1-1-60e2e36a3d46@quicinc.com>
```diff diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 93b1077a380a..2bb8b422f434 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -1625,4 +1625,5 @@ static void __exit exit_iso9660_fs(void) module_init(init_iso9660_fs) module_exit(exit_iso9660_fs) +MODULE_DESCRIPTION("ISO 9660 CDROM file system supp...
96544a93eda44ec177760ae6b511188dfc6b047e
Analyze and fix the following issue in the Linux kernel code: jbd2: add missing MODULE_DESCRIPTION()
Problem Details: Fix the 'make W=1' warning: WARNING: modpost: missing MODULE_DESCRIPTION() in fs/jbd2/jbd2.o Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Jan Kara <jack@suse.cz> Message-Id: <20240526-md-fs-jbd2-v1-1-7bba6665327d@quicinc.com>
```diff diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 03c4b9214f56..0d2825c131cc 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -3181,6 +3181,7 @@ static void __exit journal_exit(void) jbd2_journal_destroy_caches(); } +MODULE_DESCRIPTION("Generic filesystem journal-writing module"); MODULE_L...
99280413a5b785f22d91e8a8a66dc38f4a214495
Analyze and fix the following issue in the Linux kernel code: efi: Add missing __nocfi annotations to runtime wrappers
Problem Details: The EFI runtime wrappers are a sandbox for calling into EFI runtime services, which are invoked using indirect calls. When running with kCFI enabled, the compiler will require the target of any indirect call to be type annotated. Given that the EFI runtime services prototypes and calling convention ar...
```diff diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c index 5d56bc40a79d..708b777857d3 100644 --- a/drivers/firmware/efi/runtime-wrappers.c +++ b/drivers/firmware/efi/runtime-wrappers.c @@ -213,7 +213,7 @@ extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime...
172e422ffea20a89bfdc672741c1aad6fbb5044e
Analyze and fix the following issue in the Linux kernel code: fsnotify: clear PARENT_WATCHED flags lazily
Problem Details: In some setups directories can have many (usually negative) dentries. Hence __fsnotify_update_child_dentry_flags() function can take a significant amount of time. Since the bulk of this function happens under inode->i_lock this causes a significant contention on the lock when we remove the watch from t...
```diff diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index ff69ae24c4e8..272c8a1dab3c 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c @@ -117,17 +117,13 @@ void fsnotify_sb_free(struct super_block *sb) * parent cares. Thus when an event happens on a child it can quickly tell * if there is ...
7fcf26b315bbb728036da0862de6b335da83dff2
Analyze and fix the following issue in the Linux kernel code: Revert "xsk: Support redirect to any socket bound to the same umem"
Problem Details: This reverts commit 2863d665ea41282379f108e4da6c8a2366ba66db. This patch introduced a potential kernel crash when multiple napi instances redirect to the same AF_XDP socket. By removing the queue_index check, it is possible for multiple napi instances to access the Rx ring at the same time, which will...
```diff diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 727aa20be4bd..7d1c0986f9bb 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -313,13 +313,10 @@ static bool xsk_is_bound(struct xdp_sock *xs) static int xsk_rcv_check(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len) { - struct net_device *dev = xdp->rxq->d...
d0d1df8ba18abc57f28fb3bc053b2bf319367f2c
Analyze and fix the following issue in the Linux kernel code: bpf: Set run context for rawtp test_run callback
Problem Details: syzbot reported crash when rawtp program executed through the test_run interface calls bpf_get_attach_cookie helper or any other helper that touches task->bpf_ctx pointer. Setting the run context (task->bpf_ctx pointer) for test_run callback. Fixes: 7adfc6c9b315 ("bpf: Add bpf_get_attach_cookie() BPF...
```diff diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c index f6aad4ed2ab2..36ae54f57bf5 100644 --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -727,10 +727,16 @@ static void __bpf_prog_test_run_raw_tp(void *data) { struct bpf_raw_tp_test_run_info *info = data; + struct bpf_trace_run_ctx run_ctx = {}; + s...
93bbbcb1e762a49fc18ee1272545b77371595f1e
Analyze and fix the following issue in the Linux kernel code: mm/memblock: fix a typo in description of for_each_mem_region()
Problem Details: No functional change. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Link: https://lore.kernel.org/r/20240525023040.13509-2-richard.weiyang@gmail.com Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
```diff diff --git a/include/linux/memblock.h b/include/linux/memblock.h index e2082240586d..6cf18dc2b4d0 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -565,7 +565,7 @@ static inline unsigned long memblock_region_reserved_end_pfn(const struct memblo } /** - * for_each_mem_region - itereate...
3aca2cea907c647ee7720b7ba22734f9e8e7cfa3
Analyze and fix the following issue in the Linux kernel code: mm/memblock: fix comment for memblock_isolate_range()
Problem Details: The isolated range is [*@start_rgn, *@end_rgn - 1], while the comment says "the end region inside the range" is *@end_rgn. Let's correct it. Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Link: https://lore.kernel.org/r/20240507075833.6346-4-richard.weiyang@gmail.com Signed-off-by: Mike Rapoport...
```diff diff --git a/mm/memblock.c b/mm/memblock.c index 98d25689cf10..7f3cd96d6769 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -777,7 +777,8 @@ bool __init_memblock memblock_validate_numa_coverage(unsigned long threshold_byt * Walk @type and ensure that regions don't cross the boundaries defined by * [@base,...
f6df89c3582a337090ae1f37c3648bdb35da29f7
Analyze and fix the following issue in the Linux kernel code: memblock tests: add memblock_reserve_many_may_conflict_check()
Problem Details: This may trigger the case fixed by commit 48c3b583bbdd ("mm/memblock: fix overlapping allocation when doubling reserved array"). This is done by adding the 129th reserve region into memblock.memory. If memblock_double_array() use this reserve region as new array, it fails. Signed-off-by: Wei Yang <ri...
```diff diff --git a/tools/testing/memblock/tests/basic_api.c b/tools/testing/memblock/tests/basic_api.c index bd3ebbf6b697..fdac82656d15 100644 --- a/tools/testing/memblock/tests/basic_api.c +++ b/tools/testing/memblock/tests/basic_api.c @@ -1088,6 +1088,156 @@ static int memblock_reserve_all_locations_check(void) r...
131328aa5699c35ad0db0a4da75b38fae2379d23
Analyze and fix the following issue in the Linux kernel code: drm/xe/xe2lpm: Add permanent Wa_14020756599
Problem Details: For xe2_lpm Wa_14020756599 is applied to all steppings and when RCS is present on graphics GT. V5(MattR): - Add more comments about new API V4: - Make it part of lrc wa - Check for RCS as rtp rule V3(MattR): - Rename rtp api name - Use MEDIA_VERx100 V2: - Remove engine filter video decode ...
```diff diff --git a/drivers/gpu/drm/xe/xe_rtp.c b/drivers/gpu/drm/xe/xe_rtp.c index fb44cc7521d8..01c32a932780 100644 --- a/drivers/gpu/drm/xe/xe_rtp.c +++ b/drivers/gpu/drm/xe/xe_rtp.c @@ -323,3 +323,9 @@ bool xe_rtp_match_first_gslice_fused_off(const struct xe_gt *gt, return dss >= dss_per_gslice; } + +bool xe_...
0ea00e249ca992adee54dc71a526ee70ef109e40
Analyze and fix the following issue in the Linux kernel code: tpm_tis: Do *not* flush uninitialized work
Problem Details: tpm_tis_core_init() may fail before tpm_tis_probe_irq_single() is called, in which case tpm_tis_remove() unconditionally calling flush_work() is triggering a warning for .func still being NULL. Cc: stable@vger.kernel.org # v6.5+ Fixes: 481c2d14627d ("tpm,tpm_tis: Disable interrupts after 1000 unhandle...
```diff diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 176cd8dbf1db..fdef214b9f6b 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -1020,7 +1020,8 @@ void tpm_tis_remove(struct tpm_chip *chip) interrupt = 0; tpm_tis_write32(priv, reg, ~TP...
898ac74c5b5f8b551a377d6a60ca4e30023ac9d2
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Ignore .llvm.<hash> suffix in kallsyms_find()
Problem Details: I hit the following failure when running selftests with internal backported upstream kernel: test_ksyms:PASS:kallsyms_fopen 0 nsec test_ksyms:FAIL:ksym_find symbol 'bpf_link_fops' not found #123 ksyms:FAIL In /proc/kallsyms, we have $ cat /proc/kallsyms | grep bpf_link_fops ffffffff829f0...
```diff diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c index 70e29f316fe7..465d196c7165 100644 --- a/tools/testing/selftests/bpf/trace_helpers.c +++ b/tools/testing/selftests/bpf/trace_helpers.c @@ -211,7 +211,7 @@ long ksym_get_addr(const char *name) */ int ka...
baa781e1d84f2165c480c28d2c286e465d3fb2e1
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad7380: prepare for parts with more channels
Problem Details: The current driver supports only parts with 2 channels. In order to prepare the support of new compatible ADCs with more channels, this commit: - defines MAX_NUM_CHANNEL to specify the maximum number of channels currently supported by the driver - adds available_scan_mask member in ad7380_chip_...
```diff diff --git a/drivers/iio/adc/ad7380.c b/drivers/iio/adc/ad7380.c index 4ad283cf970d..790d08c90ad0 100644 --- a/drivers/iio/adc/ad7380.c +++ b/drivers/iio/adc/ad7380.c @@ -27,6 +27,7 @@ #include <linux/iio/trigger_consumer.h> #include <linux/iio/triggered_buffer.h> +#define MAX_NUM_CHANNELS 2 /* 2.5V inter...
b095217c104bca87d5e24c147b3e37cae921c441
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad7380: new driver for AD7380 ADCs
Problem Details: This adds a new driver for the AD7380 family ADCs. The driver currently implements basic support for the AD7380, AD7381, 2-channel differential ADCs. Support for additional single-ended, pseudo-differential and 4-channel chips that use the same register map as well as additional features of the chip w...
```diff diff --git a/MAINTAINERS b/MAINTAINERS index c1e62fd354b5..bff979a507ba 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -447,6 +447,7 @@ S: Supported W: https://wiki.analog.com/resources/tools-software/linux-drivers/iio-adc/ad738x W: https://ez.analog.com/linux-software-drivers F: Documentation/devicetree/bind...
202b89f4b778d86a940f693785600acaccca6a2b
Analyze and fix the following issue in the Linux kernel code: iio: adc: adi-axi-adc: don't allow concurrent enable/disable calls
Problem Details: Add proper mutex guards as we should not be able to disable the core in the middle of enabling it. Note there's no need to rush in backporting this as the only user of the backend does not do anything crazy.. Fixes: 794ef0e57854 ("iio: adc: adi-axi-adc: move to backend framework") Signed-off-by: Nuno...
```diff diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c index 0cf0d81358fd..bf51d619ebbc 100644 --- a/drivers/iio/adc/adi-axi-adc.c +++ b/drivers/iio/adc/adi-axi-adc.c @@ -85,6 +85,7 @@ static int axi_adc_enable(struct iio_backend *back) struct adi_axi_adc_state *st = iio_backend_get_priv(b...
e2261b4a4de2804698935eb44f98dc897e1c44c3
Analyze and fix the following issue in the Linux kernel code: iio: frequency: adrf6780: rm clk provider include
Problem Details: The driver has no clock provider implementation, therefore remove the include. Fixes: 63aaf6d06d87 ("iio: frequency: adrf6780: add support for ADRF6780") Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Link: https://lore.kernel.org/r/20240530092835.36892-1-antoniu.miclaus@analog.com Signed...
```diff diff --git a/drivers/iio/frequency/adrf6780.c b/drivers/iio/frequency/adrf6780.c index b4defb82f37e..3f46032c9275 100644 --- a/drivers/iio/frequency/adrf6780.c +++ b/drivers/iio/frequency/adrf6780.c @@ -9,7 +9,6 @@ #include <linux/bits.h> #include <linux/clk.h> #include <linux/clkdev.h> -#include <linux/clk-...
0fbce5d171e489cd21a67773331716c9cc752890
Analyze and fix the following issue in the Linux kernel code: dt-bindings: iio: dac: fix ad3552r gain parameter names
Problem Details: The adi,gain-scaling-p/n values are an inverted log2, so initial naming was set correctly, but the driver uses just adi,gain-scaling-p/n, and if fdt is created accordingly with the fdt bindings documentation, driver fails the probe. Observing that: - the Linux driver is the only consumer, - there are ...
```diff diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad3552r.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad3552r.yaml index 96340a05754c..b4a5542060eb 100644 --- a/Documentation/devicetree/bindings/iio/dac/adi,ad3552r.yaml +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad3552r.yaml @@ -92,13...
7a8e7f13f99b31c85b77b362cb7b7a23fead11d3
Analyze and fix the following issue in the Linux kernel code: iio: adc: ad9467: use DMA safe buffer for spi
Problem Details: Make sure we use a DMA safe buffer (IIO_DMA_MINALIGN) for all the spi transfers. Only relevant for writes since for reads spi_write_then_read() is used which does not require DMA safe buffers. Also note that for consistency, ad9467_spi_read() is also taking struct ad9467_state as a parameter (even if ...
```diff diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c index e85b763b9ffc..3571cfe0f9cc 100644 --- a/drivers/iio/adc/ad9467.c +++ b/drivers/iio/adc/ad9467.c @@ -141,9 +141,10 @@ struct ad9467_state { struct gpio_desc *pwrdown_gpio; /* ensure consistent state obtained on multiple related accesses ...
6ea810cfb80c054eff72f1a55b6dcd22486baa33
Analyze and fix the following issue in the Linux kernel code: clk: sifive: prci: fix module autoloading
Problem Details: Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table. Clocks are considered core components, so usually they are built-in, however these can be built and used as modules on some generic kernel. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.or...
```diff diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c index 25b8e1a80ddc..700a1be9ec47 100644 --- a/drivers/clk/sifive/sifive-prci.c +++ b/drivers/clk/sifive/sifive-prci.c @@ -611,6 +611,7 @@ static const struct of_device_id sifive_prci_of_match[] = { {.compatible = "sifive,fu740-c0...
61ce0ea7591fef2eb6e89ce40ffcc24fda4dbbc5
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Fix bpf_cookie and find_vma in nested VM
Problem Details: bpf_cookie and find_vma are flaky in nested VMs, which is used by some CI systems. It turns out these failures are caused by unreliable perf event in nested VM. Fix these by: 1. Use PERF_COUNT_SW_CPU_CLOCK in find_vma; 2. Increase sample_freq in bpf_cookie. Signed-off-by: Song Liu <song@kernel.or...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_cookie.c b/tools/testing/selftests/bpf/prog_tests/bpf_cookie.c index 4407ea428e77..070c52c312e5 100644 --- a/tools/testing/selftests/bpf/prog_tests/bpf_cookie.c +++ b/tools/testing/selftests/bpf/prog_tests/bpf_cookie.c @@ -451,7 +451,7 @@ static void pe_su...
4eecb644b8b82f5279a348f6ebe77e3d6e5b1b05
Analyze and fix the following issue in the Linux kernel code: spi: cs42l43: Correct SPI root clock speed
Problem Details: The root clock is actually 49.152MHz not 40MHz, as it is derived from the primary audio clock, update the driver to match. This error can cause the actual clock rate to be higher than the requested clock rate on the SPI bus. Fixes: ef75e767167a ("spi: cs42l43: Add SPI controller support") Signed-off-b...
```diff diff --git a/drivers/spi/spi-cs42l43.c b/drivers/spi/spi-cs42l43.c index 9d747ea69926..902a0734cc36 100644 --- a/drivers/spi/spi-cs42l43.c +++ b/drivers/spi/spi-cs42l43.c @@ -26,7 +26,7 @@ #include <linux/units.h> #define CS42L43_FIFO_SIZE 16 -#define CS42L43_SPI_ROOT_HZ (40 * HZ_PER_MHZ) +#define CS42L43...
afe377286ad49e0b69071d2a767e2c6553f4094b
Analyze and fix the following issue in the Linux kernel code: ASoC: cs42l43: Increase default type detect time and button delay
Problem Details: Some problematic headsets have been discovered, to help with correctly identifying these, the detect time must be increased. Also improve the reliability of the impedance value from the button detect by slightly increasing the button detect delay. Fixes: 686b8f711b99 ("ASoC: cs42l43: Lower default typ...
```diff diff --git a/sound/soc/codecs/cs42l43-jack.c b/sound/soc/codecs/cs42l43-jack.c index 901b9dbcf585..d9ab003e166b 100644 --- a/sound/soc/codecs/cs42l43-jack.c +++ b/sound/soc/codecs/cs42l43-jack.c @@ -121,7 +121,7 @@ int cs42l43_set_jack(struct snd_soc_component *component, priv->buttons[3] = 735; } - ret ...
d9fef76e89498bf99cdb03f77b7091d7e95d7edd
Analyze and fix the following issue in the Linux kernel code: thermal/drivers/mediatek/lvts_thermal: Remove filtered mode for mt8188
Problem Details: Filtered mode is not supported on mt8188 SoC and is the source of bad results. Move to immediate mode which provides good temperatures. Fixes: f4745f546e60 ("thermal/drivers/mediatek/lvts_thermal: Add MT8188 support") Reviewed-by: Nicolas Pitre <npitre@baylibre.com> Reviewed-by: AngeloGioacchino Del R...
```diff diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index 0bb3a495b56e..82c355c466cf 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -1458,7 +1458,6 @@ static const struct lvts_ctrl_data mt8188_lvts_mcu_data_ctrl[] ...
c9d52fb313d3719d69a040f4ca78a3e2e95fba21
Analyze and fix the following issue in the Linux kernel code: PCI: Revert the cfg_access_lock lockdep mechanism
Problem Details: While the experiment did reveal that there are additional places that are missing the lock during secondary bus reset, one of the places that needs to take cfg_access_lock (pci_bus_lock()) is not prepared for lockdep annotation. Specifically, pci_bus_lock() takes pci_dev_lock() recursively and is curr...
```diff diff --git a/drivers/pci/access.c b/drivers/pci/access.c index 30f031de9cfe..b123da16b63b 100644 --- a/drivers/pci/access.c +++ b/drivers/pci/access.c @@ -289,8 +289,6 @@ void pci_cfg_access_lock(struct pci_dev *dev) { might_sleep(); - lock_map_acquire(&dev->cfg_access_lock); - raw_spin_lock_irq(&pci_loc...
3d8e253724170ae9c8948c36801204fc2aa53682
Analyze and fix the following issue in the Linux kernel code: dt-bindings: hwmon: g762: Convert to yaml schema
Problem Details: Convert g762 Documentation to yaml schema and port all the custom properties and info. Add the vendor prefix to name to follow naming standard. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/r/20240604164348.542-1...
```diff diff --git a/Documentation/devicetree/bindings/hwmon/g762.txt b/Documentation/devicetree/bindings/hwmon/g762.txt deleted file mode 100644 index 6d154c4923de..000000000000 --- a/Documentation/devicetree/bindings/hwmon/g762.txt +++ /dev/null @@ -1,47 +0,0 @@ -GMT G762/G763 PWM Fan controller - -Required node prop...
30ca6365bb4200f55e59bf1ab2a24e65406e9eac
Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix assert on pending async-put power domain work when it requeues itself
Problem Details: Commit dd839aa857eb ("drm/i915: Fix incorrect assert about pending power domain async-put work") fixed the assert about a pending work dropping a display power reference asynchronously, leading to the drm_WARN_ON(!queue_delayed_work(&power_domains->async_put_work)); warn next time around a power ref...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c b/drivers/gpu/drm/i915/display/intel_display_power.c index 34b6d843bc9e..8c49ac053dfb 100644 --- a/drivers/gpu/drm/i915/display/intel_display_power.c +++ b/drivers/gpu/drm/i915/display/intel_display_power.c @@ -675,6 +675,12 @@ intel_display_power_...
c0a40097f0bc81deafc15f9195d1fb54595cd6d0
Analyze and fix the following issue in the Linux kernel code: drivers: core: synchronize really_probe() and dev_uevent()
Problem Details: Synchronize the dev->driver usage in really_probe() and dev_uevent(). These can run in different threads, what can result in the following race condition for dev->driver uninitialization: Thread #1: ========== really_probe() { ... probe_failed: ... device_unbind_cleanup(dev) { ... dev->driver...
```diff diff --git a/drivers/base/core.c b/drivers/base/core.c index 2e776fcc31b6..2b4c0624b704 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -2739,8 +2739,11 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr, if (!env) return -ENOMEM; + /* Synchronize with really_pr...
41fca5930afb36453cc90d4002841edd9990d0ad
Analyze and fix the following issue in the Linux kernel code: arm64: dts: qcom: sa8775p: Correct IRQ number of EL2 non-secure physical timer
Problem Details: The INTID of EL2 non-secure physical timer is 26. In linux, the IRQ number has a fixed 16 offset for PPIs. Therefore, the linux IRQ number of EL2 non-secure physical timer should be 10 (26 - 16). Fixes: 603f96d4c9d0 ("arm64: dts: qcom: add initial support for qcom sa8775p-ride") Signed-off-by: Cong Zh...
```diff diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qcom/sa8775p.dtsi index 31de73594839..1b3dc0ece54d 100644 --- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi +++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi @@ -3605,7 +3605,7 @@ interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LO...
616501eccb58615f8f352a29239ea6c6fc5e6546
Analyze and fix the following issue in the Linux kernel code: clkdev: don't fail clkdev_alloc() if over-sized
Problem Details: Don't fail clkdev_alloc() if the strings are over-sized. In this case, the entry will not match during lookup, so its useless. However, since code fails if we return NULL leading to boot failure, return a dummy entry with the connection and device IDs set to "bad". Leave the warning so these problems ...
```diff diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 56a12f1da472..476fb9b7adb5 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -204,8 +204,15 @@ fail: pr_err("%pV:%s: %s ID is greater than %zu\n", &vaf, con_id, failure, max_size); va_end(ap_copy); - kfree(cla); - return N...
7c55b78818cfb732680c4a72ab270cc2d2ee3d0f
Analyze and fix the following issue in the Linux kernel code: jfs: xattr: fix buffer overflow for invalid xattr
Problem Details: When an xattr size is not what is expected, it is printed out to the kernel log in hex format as a form of debugging. But when that xattr size is bigger than the expected size, printing it out can cause an access off the end of the buffer. Fix this all up by properly restricting the size of the debug...
```diff diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 0fb7afac298e..9987055293b3 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c @@ -557,9 +557,11 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size) size_check: if (EALIST_SIZE(ea_buf->xattr) != ea_size) { + int size = min...
77427e3d5c353e3dd98c7c0af322f8d9e3131ace
Analyze and fix the following issue in the Linux kernel code: misc: microchip: pci1xxxx: Fix a memory leak in the error handling of gp_aux_bus_probe()
Problem Details: There is a memory leak (forget to free allocated buffers) in a memory allocation failure path. Fix it to jump to the correct error handling code. Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.") Signed...
```diff diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c index de75d89ef53e..34c9be437432 100644 --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c @@ -69,8 +69,10 @@ static int gp_aux_bus_probe(struct pci_dev...
086c6cbcc563c81d55257f9b27e14faf1d0963d3
Analyze and fix the following issue in the Linux kernel code: misc: microchip: pci1xxxx: fix double free in the error handling of gp_aux_bus_probe()
Problem Details: When auxiliary_device_add() returns error and then calls auxiliary_device_uninit(), callback function gp_auxiliary_device_release() calls ida_free() and kfree(aux_device_wrapper) to free memory. We should't call them again in the error handling path. Fix this by skipping the redundant cleanup function...
```diff diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c index 32af2b14ff34..de75d89ef53e 100644 --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c @@ -111,6 +111,7 @@ static int gp_aux_bus_probe(struct pci_de...
2b82641ad0620b2d71dc05024b20f82db7e1c0b6
Analyze and fix the following issue in the Linux kernel code: eeprom: digsy_mtc: Fix 93xx46 driver probe failure
Problem Details: The update to support other (bigger) types of EEPROMs broke the driver loading due to removal of the default size. Fix this by adding the respective (new) flag to the platform data. Fixes: 14374fbb3f06 ("misc: eeprom_93xx46: Add new 93c56 and 93c66 compatible strings") Signed-off-by: Andy Shevchenko ...
```diff diff --git a/drivers/misc/eeprom/digsy_mtc_eeprom.c b/drivers/misc/eeprom/digsy_mtc_eeprom.c index f1f766b70965..4eddc5ba1af9 100644 --- a/drivers/misc/eeprom/digsy_mtc_eeprom.c +++ b/drivers/misc/eeprom/digsy_mtc_eeprom.c @@ -42,7 +42,7 @@ static void digsy_mtc_op_finish(void *p) } struct eeprom_93xx46_pla...
af076156ec6d70332f1555754e99d4a3771ec297
Analyze and fix the following issue in the Linux kernel code: mei: vsc: Fix wrong invocation of ACPI SID method
Problem Details: When using an initializer for a union only one of the union members must be initialized. The initializer for the acpi_object union variable passed as argument to the SID ACPI method was initializing both the type and the integer members of the union. Unfortunately rather then complaining about this gc...
```diff diff --git a/drivers/misc/mei/vsc-fw-loader.c b/drivers/misc/mei/vsc-fw-loader.c index ffa4ccd96a10..596a9d695dfc 100644 --- a/drivers/misc/mei/vsc-fw-loader.c +++ b/drivers/misc/mei/vsc-fw-loader.c @@ -252,7 +252,7 @@ static int vsc_get_sensor_name(struct vsc_fw_loader *fw_loader, { struct acpi_buffer buffe...
9b5e045029d8bded4c6979874ed3abc347c1415c
Analyze and fix the following issue in the Linux kernel code: mei: vsc: Don't stop/restart mei device during system suspend/resume
Problem Details: The dynamically created mei client device (mei csi) is used as one V4L2 sub device of the whole video pipeline, and the V4L2 connection graph is built by software node. The mei_stop() and mei_restart() will delete the old mei csi client device and create a new mei client device, which will cause the so...
```diff diff --git a/drivers/misc/mei/platform-vsc.c b/drivers/misc/mei/platform-vsc.c index b543e6b9f3cf..1ec65d87488a 100644 --- a/drivers/misc/mei/platform-vsc.c +++ b/drivers/misc/mei/platform-vsc.c @@ -399,41 +399,32 @@ static void mei_vsc_remove(struct platform_device *pdev) static int mei_vsc_suspend(struct d...
5a71c0d1180e76d223a8266799d1ee4ba3a8e697
Analyze and fix the following issue in the Linux kernel code: dyndbg: add missing MODULE_DESCRIPTION() macro
Problem Details: make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in lib/test_dynamic_debug.o Add the missing invocation of the MODULE_DESCRIPTION() macro. Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com> Link: https://lore.kernel.org/r/20240531-md-test_dynamic_debug-v1...
```diff diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 8dd250ad022b..77c2a669b6af 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -162,4 +162,5 @@ module_init(test_dynamic_debug_init); module_exit(test_dynamic_debug_exit); MODULE_AUTHOR("Jim Cromie <jim.cromie@gmail.c...
6392194470575de1ac0cb7223ff3bf30da94bbea
Analyze and fix the following issue in the Linux kernel code: uio: add missing MODULE_DESCRIPTION() macros
Problem Details: Fix the 'make W=1' warnings: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/uio/uio.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/uio/uio_cif.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/uio/uio_aec.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/uio/...
```diff diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 5ce429286ab0..20d2a55cb40b 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -1145,4 +1145,5 @@ static void __exit uio_exit(void) module_init(uio_init) module_exit(uio_exit) +MODULE_DESCRIPTION("Userspace IO core module"); MODULE_LICENSE("GPL...
283cb234ef95d94c61f59e1cd070cd9499b51292
Analyze and fix the following issue in the Linux kernel code: mei: me: release irq in mei_me_pci_resume error path
Problem Details: The mei_me_pci_resume doesn't release irq on the error path, in case mei_start() fails. Cc: <stable@kernel.org> Fixes: 33ec08263147 ("mei: revamp mei reset state machine") Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20240604090728.1027307-1-tomas.winkler@inte...
```diff diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index 7f59dd38c32f..6589635f8ba3 100644 --- a/drivers/misc/mei/pci-me.c +++ b/drivers/misc/mei/pci-me.c @@ -385,8 +385,10 @@ static int mei_me_pci_resume(struct device *device) } err = mei_restart(dev); - if (err) + if (err) { + free_irq(...
1db5322b7e6b58e1b304ce69a50e9dca798ca95b
Analyze and fix the following issue in the Linux kernel code: mei: demote client disconnect warning on suspend to debug
Problem Details: Change level for the "not connected" client message in the write callback from error to debug. The MEI driver currently disconnects all clients upon system suspend. This behavior is by design and user-space applications with open connections before the suspend are expected to handle errors upon resume...
```diff diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 79e6f3c1341f..40c3fe26f76d 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -329,7 +329,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, } if (!mei_cl_is_connected(cl)) { - cl_err(dev, cl, "...
0698ff57bf327d9a5735a898f78161b8dada160b
Analyze and fix the following issue in the Linux kernel code: drm/xe/pf: Update the LMTT when freeing VF GT config
Problem Details: The LMTT must be updated whenever we change the VF LMEM configuration. We missed that step when freeing the whole VF GT config, which could result in stale PTE in LMTT or LMTT PT object leaks. Fix that. Fixes: ac6598aed1b3 ("drm/xe/pf: Add support to configure SR-IOV VFs") Signed-off-by: Michal Wajdec...
```diff diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c index 79116ad58620..476d613333a9 100644 --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c @@ -1749,6 +1749,7 @@ static void pf_release_vf_config(struct xe_gt *gt, ...
1aea3d1d4a21e3e7895663b848ffae79ee82e065
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: avoid_externs
Problem Details: This patch fixes the following checkpatch warnings: CHECK:AVOID_EXTERNS: extern prototypes should be avoided in .h files Removing unnecessary 'extern' declaration of function prototypes in header files. Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisc...
```diff diff --git a/drivers/staging/media/av7110/av7110.h b/drivers/staging/media/av7110/av7110.h index 403dbbba5b5b..ec461fd187af 100644 --- a/drivers/staging/media/av7110/av7110.h +++ b/drivers/staging/media/av7110/av7110.h @@ -284,8 +284,8 @@ struct av7110 { int (*fe_set_frontend)(struct dvb_frontend *fe); }; ...
908b202653cde20c4245f27a91308ce905b952a5
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: deep_indentation
Problem Details: This patch fixes most the following checkpatch warnings: WARNING:DEEP_INDENTATION: Too many leading tabs - consider code refactoring Invert "if" statement to reduce indention level by 1. Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
```diff diff --git a/drivers/staging/media/av7110/av7110_ipack.c b/drivers/staging/media/av7110/av7110_ipack.c index 9631aae71fc0..4be6e225f08e 100644 --- a/drivers/staging/media/av7110/av7110_ipack.c +++ b/drivers/staging/media/av7110/av7110_ipack.c @@ -249,146 +249,146 @@ int av7110_ipack_instant_repack(const u8 *buf...
64b84024314e69b9c588e8fa38e565ac4dc3c1f8
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: miscellaneous
Problem Details: This patch fixes the following checkpatch warnings: WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message CHECK:MACRO_ARG_REUSE: Macro argument reuse 'fe_func' - possible side-effects? The MACRO_ARG_REUSE isn't really fixed but marked as intentional. The comment is visible in the checkpat...
```diff diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index 14c512fdfa47..30e2e6e65148 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -108,7 +108,7 @@ static int av7110_num; av7110_copy = fe_func; \ fe_func = av7110_fu...
a6257cc79aed1de04a6e84c789a1e8609411346b
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: variable types
Problem Details: This patch fixes the following checkpatch warnings: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 's32' over 'int32_t' CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u64' over 'uint64_t' WARNING:UNNECESSARY_INT: Prefer 'long' over 'long int' as the int is unnecessary WARNING:UNSPECIFIED_INT: Prefer 'u...
```diff diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index 42b5d049ec12..14c512fdfa47 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -1094,7 +1094,7 @@ static void restart_feeds(struct av7110 *av7110) } static int dvb_g...
e7b9b556aa799fd7a917801a6afc86f4317532fc
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: sizeof
Problem Details: This patch fixes the following checkpatch warnings: WARNING:SIZEOF_PARENTHESIS: sizeof d should be sizeof(d) WARNING:SIZEOF_PARENTHESIS: sizeof f->fmt.sliced should be sizeof(f->fmt.sliced) WARNING:CONST_STRUCT: struct dvb_frontend_ops should normally be const CHECK:ALLOC_SIZEOF_STRUCT: Prefer kzalloc...
```diff diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index de9476154075..42b5d049ec12 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -2437,7 +2437,7 @@ static int av7110_attach(struct saa7146_dev *dev, } /* prepare th...
3c08dc38e3cf018a74c64e75cebcc803d973196c
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: comparsations
Problem Details: This patch fixes the following checkpatch warnings: WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written ... Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hv...
```diff diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index fac774dc6eab..de9476154075 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -104,7 +104,7 @@ static int av7110_num; #define FE_FUNC_OVERRIDE(fe_func, av7110_copy, ...
e198cabc5d49f18f17c5cc2e9e4c7203e58e2dc6
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: assignments
Problem Details: This patch fixes the following checkpatch errors: ERROR:ASSIGN_IN_IF: do not use assignment in if condition CHECK:MULTIPLE_ASSIGNMENTS: multiple assignments should be avoided Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
```diff diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index 78d708ffc8f3..fac774dc6eab 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -709,7 +709,11 @@ static inline int SetPIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16...
28ada7d1f9fbf82d17665a68730b17af59874862
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: braces
Problem Details: This patch fixes the following checkpatch warnings and errors: WARNING:BRACES: braces {} are not necessary for any arm of this statement WARNING:BRACES: braces {} are not necessary for single statement blocks CHECK:BRACES: braces {} should be used on all arms of this statement CHECK:BRACES: Unbalanced...
```diff diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index 49735cbb2ea4..78d708ffc8f3 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -408,10 +408,11 @@ static void debiirq(struct tasklet_struct *t) if (data[5] > 5) ...
043dc67f27d64fb4764d24ec9f5686b00aa9a1cd
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: comments
Problem Details: This patch fixes the following checkpatch warnings: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 1 WARNING:EMBEDD...
```diff diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index 27019e3f3a45..49735cbb2ea4 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * driver for the SAA7146 ...
2ee76a601ec3246424483ccfd88d7bd0ddeea2ef
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: newline
Problem Details: This patch fixes the following checkpatch warnings: ERROR:ELSE_AFTER_BRACE: else should follow close brace '}' ERROR:OPEN_BRACE: open brace '{' following enum go on the same line ERROR:OPEN_BRACE: open brace '{' following struct go on the same line ERROR:OPEN_BRACE: that open brace { should be on the ...
```diff diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index 557f4235251b..8a4e7bd8222e 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -161,13 +161,11 @@ static void init_av7110_av(struct av7110 *av7110) */ } else if (0...
83ab91364917b379c66ff1068239e1017992cf57
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: whitespace
Problem Details: This patch fixes the following checkpatch warnings: ERROR:SPACING: need consistent spacing around '&' (ctx:WxO) ERROR:SPACING: need consistent spacing around '&' (ctx:WxV) ERROR:SPACING: need consistent spacing around '-' (ctx:WxV) ERROR:SPACING: space prohibited after that '~' (ctx:OxW) ERROR:SPACING...
```diff diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index b19c27f6e478..557f4235251b 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -72,11 +72,11 @@ static int full_ts; module_param_named(debug, av7110_debug, int, 0644); ...
3b013d82145a433cd101096e9d1cec67eefb7fa1
Analyze and fix the following issue in the Linux kernel code: media: av7110: coding style fixes: pointer_location
Problem Details: This patch fixes the following checkpatch warnings: ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar" ERROR:POINTER_LOCATION: "foo* bar" should be "foo *bar" ERROR:POINTER_LOCATION: "(foo*)" should be "(foo *)" Whitespace changes only. "git diff -w" shows no changes. Signed-off-by: Stefan Her...
```diff diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c index a5a431c14ea7..eb1dc64bc8eb 100644 --- a/drivers/staging/media/av7110/av7110.c +++ b/drivers/staging/media/av7110/av7110.c @@ -429,7 +429,7 @@ static void debiirq(struct tasklet_struct *t) break; case DATA_DEB...
47da4d15c93aaf055225106b382423453f5eecc8
Analyze and fix the following issue in the Linux kernel code: media: sp8870: coding style fixes: logging
Problem Details: This patch fixes the following checkpatch warnings: WARNING:PREFER_PR_LEVEL: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ... WARNING:PRINTK_WITHOUT_KERN_LEVEL: printk() should include KERN_<LEVEL> facility level WARNING:TRACING_LO...
```diff diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c index 282beb15737f..0c813860f5b2 100644 --- a/drivers/staging/media/av7110/sp8870.c +++ b/drivers/staging/media/av7110/sp8870.c @@ -11,6 +11,12 @@ * download/extract it, and then copy it to /usr/lib/hotplug/firmware *...
72707bdc22e2586232585935fa088bedb9a8940d
Analyze and fix the following issue in the Linux kernel code: media: sp8870: coding style fixes: miscellaneous
Problem Details: This patch fixes the following checkpatch: ERROR:ASSIGN_IN_IF: do not use assignment in if condition WARNING:BRACES: braces {} are not necessary for any arm of this statement WARNING:CONST_STRUCT: struct dvb_frontend_ops should normally be const WARNING:EXPORT_SYMBOL: EXPORT_SYMBOL(foo); should immedi...
```diff diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c index 4e2a1cbd4538..282beb15737f 100644 --- a/drivers/staging/media/av7110/sp8870.c +++ b/drivers/staging/media/av7110/sp8870.c @@ -59,7 +59,8 @@ static int sp8870_writereg(struct sp8870_state *state, u16 reg, u16 data) ...
5f0edb7a8ba01f9328b6899282ac577c15d2a6af
Analyze and fix the following issue in the Linux kernel code: media: sp8870: coding style fixes: newline, comments and braces
Problem Details: This patch fixes the following checkpatch warnings: ERROR:OPEN_BRACE: open brace '{' following struct go on the same line ERROR:TRAILING_STATEMENTS: trailing statements should be on next line [*] WARNING:LINE_SPACING: Missing a blank line after declarations WARNING:BLOCK_COMMENT_STYLE: Block comments ...
```diff diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c index 4fb8518d2926..4e2a1cbd4538 100644 --- a/drivers/staging/media/av7110/sp8870.c +++ b/drivers/staging/media/av7110/sp8870.c @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - Driver for Spase SP8...
5a053c05a81eb18b2393f4dd1634a3887831f037
Analyze and fix the following issue in the Linux kernel code: media: sp8870: coding style fixes: whitespace
Problem Details: This patch fixes the following checkpatch warnings: ERROR:BRACKET_SPACE: space prohibited before open square bracket '[' ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar" ERROR:POINTER_LOCATION: "foo* bar" should be "foo *bar" ERROR:SPACING: space prohibited before that ',' (ctx:WxW) ERROR:SPAC...
```diff diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c index abf5c72607b6..4fb8518d2926 100644 --- a/drivers/staging/media/av7110/sp8870.c +++ b/drivers/staging/media/av7110/sp8870.c @@ -28,9 +28,9 @@ struct sp8870_state { - struct i2c_adapter* i2c; + struct i2c_adapter ...
9e438fe31e96b75c2ec599f6a9239950e6712358
Analyze and fix the following issue in the Linux kernel code: HID: intel-ish-hid: fix endian-conversion
Problem Details: The newly added file causes a ton of sparse warnings about the incorrect use of __le32 and similar types: drivers/hid/intel-ish-hid/ishtp/loader.h:41:23: error: invalid bitfield specifier for type restricted __le32. drivers/hid/intel-ish-hid/ishtp/loader.h:42:27: error: invalid bitfield specifier for ...
```diff diff --git a/drivers/hid/intel-ish-hid/ishtp/loader.c b/drivers/hid/intel-ish-hid/ishtp/loader.c index 2785b04a2f5a..fcca070bdecb 100644 --- a/drivers/hid/intel-ish-hid/ishtp/loader.c +++ b/drivers/hid/intel-ish-hid/ishtp/loader.c @@ -84,8 +84,8 @@ static int loader_write_message(struct ishtp_device *dev, void ...
655a8a7684b897721f87c59798fd04d8b79f1b69
Analyze and fix the following issue in the Linux kernel code: HID: nintendo: Fix an error handling path in nintendo_hid_probe()
Problem Details: joycon_leds_create() has a ida_alloc() call. So if an error occurs after it, a corresponding ida_free() call is needed, as already done in the .remove function. This is not 100% perfect, because if ida_alloc() fails, then 'ctlr->player_id' will forced to be U32_MAX, and an error will be logged when id...
```diff diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c index b4a97803eca3..3062daf68d31 100644 --- a/drivers/hid/hid-nintendo.c +++ b/drivers/hid/hid-nintendo.c @@ -2725,13 +2725,13 @@ static int nintendo_hid_probe(struct hid_device *hdev, ret = joycon_power_supply_create(ctlr); if (ret) { ...
ce3af2ee95170b7d9e15fff6e500d67deab1e7b3
Analyze and fix the following issue in the Linux kernel code: HID: logitech-dj: Fix memory leak in logi_dj_recv_switch_to_dj_mode()
Problem Details: Fix a memory leak on logi_dj_recv_send_report() error path. Fixes: 6f20d3261265 ("HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode()") Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
```diff diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index 3c3c497b6b91..37958edec55f 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -1284,8 +1284,10 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, */ msleep(50); -...
45f4ea9bcfe909b3461059990b1e232e55dde809
Analyze and fix the following issue in the Linux kernel code: KVM: arm64: Fix prototype for __sve_save_state/__sve_restore_state
Problem Details: Since the prototypes for __sve_save_state/__sve_restore_state at hyp were added, the underlying macro has acquired a third parameter for saving/restoring ffr. Fix the prototypes to account for the third parameter, and restore the ffr for the guest since it is saved. Suggested-by: Mark Brown <broonie@...
```diff diff --git a/arch/arm64/include/asm/kvm_hyp.h b/arch/arm64/include/asm/kvm_hyp.h index 2ab23589339a..686cce7e4e96 100644 --- a/arch/arm64/include/asm/kvm_hyp.h +++ b/arch/arm64/include/asm/kvm_hyp.h @@ -111,8 +111,8 @@ void __debug_restore_host_buffers_nvhe(struct kvm_vcpu *vcpu); void __fpsimd_save_state(st...
44a45be57f85165761fdabf072f9a97aa026ff61
Analyze and fix the following issue in the Linux kernel code: sysfs: Unbreak the build around sysfs_bin_attr_simple_read()
Problem Details: Günter reports build breakage for m68k "m5208evb_defconfig" plus CONFIG_BLK_DEV_INITRD=y caused by commit 66bc1a173328 ("treewide: Use sysfs_bin_attr_simple_read() helper"). The defconfig disables CONFIG_SYSFS, so sysfs_bin_attr_simple_read() is not compiled into the kernel. But init/initramfs.c refe...
```diff diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index a7d725fbf739..c4e64dc11206 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -750,6 +750,15 @@ static inline int sysfs_emit_at(char *buf, int at, const char *fmt, ...) { return 0; } + +static inline ssize_t sysfs_bin_attr_simpl...
99516f76db48e1a9d54cdfed63c1babcee4e71a5
Analyze and fix the following issue in the Linux kernel code: usb: typec: ucsi: Fix null pointer dereference in trace
Problem Details: ucsi_register_altmode checks IS_ERR for the alt pointer and treats NULL as valid. When CONFIG_TYPEC_DP_ALTMODE is not enabled, ucsi_register_displayport returns NULL which causes a NULL pointer dereference in trace. Rather than return NULL, call typec_port_register_altmode to register DisplayPort alter...
```diff diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h index e70cf5b15562..8b4cd0c879a8 100644 --- a/drivers/usb/typec/ucsi/ucsi.h +++ b/drivers/usb/typec/ucsi/ucsi.h @@ -501,7 +501,7 @@ ucsi_register_displayport(struct ucsi_connector *con, bool override, int offset, struct typec...
8b6b386f9aa936ed0c190446c71cf59d4a507690
Analyze and fix the following issue in the Linux kernel code: usbip: Don't submit special requests twice
Problem Details: Skip submitting URBs, when identical requests were already sent in tweak_special_requests(). Instead call the completion handler directly to return the result of the URB. Even though submitting those requests twice should be harmless, there are USB devices that react poorly to some duplicated requests...
```diff diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c index fc01b31bbb87..6338d818bc8b 100644 --- a/drivers/usb/usbip/stub_rx.c +++ b/drivers/usb/usbip/stub_rx.c @@ -144,53 +144,62 @@ static int tweak_set_configuration_cmd(struct urb *urb) if (err && err != -ENODEV) dev_err(&sdev->udev->de...
73254a297c2dd094abec7c9efee32455ae875bdf
Analyze and fix the following issue in the Linux kernel code: io_uring: fix possible deadlock in io_register_iowq_max_workers()
Problem Details: The io_register_iowq_max_workers() function calls io_put_sq_data(), which acquires the sqd->lock without releasing the uring_lock. Similar to the commit 009ad9f0c6ee ("io_uring: drop ctx->uring_lock before acquiring sqd->lock"), this can lead to a potential deadlock situation. To resolve this issue, t...
```diff diff --git a/io_uring/register.c b/io_uring/register.c index ef8c908346a4..c0010a66a6f2 100644 --- a/io_uring/register.c +++ b/io_uring/register.c @@ -355,8 +355,10 @@ static __cold int io_register_iowq_max_workers(struct io_ring_ctx *ctx, } if (sqd) { + mutex_unlock(&ctx->uring_lock); mutex_unlock(&s...
91215f70ea8541e9011c0b48f8b59b9e0ce6953b
Analyze and fix the following issue in the Linux kernel code: io_uring/io-wq: avoid garbage value of 'match' in io_wq_enqueue()
Problem Details: Clang static checker (scan-build) warning: o_uring/io-wq.c:line 1051, column 3 The expression is an uninitialized value. The computed value will also be garbage. 'match.nr_pending' is used in io_acct_cancel_pending_work(), but it is not fully initialized. Change the order of assignment for 'match' to ...
```diff diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c index d1c47a9d9215..7d3316fe9bfc 100644 --- a/io_uring/io-wq.c +++ b/io_uring/io-wq.c @@ -927,7 +927,11 @@ void io_wq_enqueue(struct io_wq *wq, struct io_wq_work *work) { struct io_wq_acct *acct = io_work_get_acct(wq, work); unsigned long work_flags = work->...
16637fea001ab3c8df528a8995b3211906165a30
Analyze and fix the following issue in the Linux kernel code: usb-storage: alauda: Check whether the media is initialized
Problem Details: The member "uzonesize" of struct alauda_info will remain 0 if alauda_init_media() fails, potentially causing divide errors in alauda_read_data() and alauda_write_lba(). - Add a member "media_initialized" to struct alauda_info. - Change a condition in alauda_check_media() to ensure the first initializ...
```diff diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c index 115f05a6201a..40d34cc28344 100644 --- a/drivers/usb/storage/alauda.c +++ b/drivers/usb/storage/alauda.c @@ -105,6 +105,8 @@ struct alauda_info { unsigned char sense_key; unsigned long sense_asc; /* additional sense code */ unsi...
8bdf8a42bca4f47646fd105a387ab6926948c7f1
Analyze and fix the following issue in the Linux kernel code: usb: typec: ucsi: Ack also failed Get Error commands
Problem Details: It is possible that also the GET_ERROR command fails. If that happens, the command completion still needs to be acknowledged. Otherwise the interface will be stuck until it's reset. Reported-by: Ammy Yi <ammy.yi@intel.com> Fixes: bdc62f2bae8f ("usb: typec: ucsi: Simplified registration and I/O API") C...
```diff diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index cb52e7b0a2c5..2cc7aedd490f 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -153,8 +153,13 @@ static int ucsi_exec_command(struct ucsi *ucsi, u64 cmd) } if (cci & UCSI_CCI_ERROR) { - if (cmd ...
f85d39dd7ed89ffdd622bc1de247ffba8d961504
Analyze and fix the following issue in the Linux kernel code: kcov, usb: disable interrupts in kcov_remote_start_usb_softirq
Problem Details: After commit 8fea0c8fda30 ("usb: core: hcd: Convert from tasklet to BH workqueue"), usb_giveback_urb_bh() runs in the BH workqueue with interrupts enabled. Thus, the remote coverage collection section in usb_giveback_urb_bh()-> __usb_hcd_giveback_urb() might be interrupted, and the interrupt handler m...
```diff diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index e3366f4d82b9..1ff7d901fede 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1623,6 +1623,7 @@ static void __usb_hcd_giveback_urb(struct urb *urb) struct usb_hcd *hcd = bus_to_hcd(urb->dev->bus); struct usb_anchor *anchor ...
e4228cfd092351c2d9b1a3048b2070287291ccbb
Analyze and fix the following issue in the Linux kernel code: dt-bindings: usb: realtek,rts5411: Add missing "additionalProperties" on child nodes
Problem Details: All nodes need an explicit additionalProperties or unevaluatedProperties unless a $ref has one that's false. As that is not the case with usb-device.yaml, "additionalProperties" is needed here. Fixes: c44d9dab31d6 ("dt-bindings: usb: Add downstream facing ports to realtek binding") Signed-off-by: "Rob...
```diff diff --git a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml index 0874fc21f66f..6577a61cc075 100644 --- a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml +++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml @@ -65,6 ...
fc8fb9eea94d8f476e15f3a4a7addeb16b3b99d6
Analyze and fix the following issue in the Linux kernel code: usb: typec: tcpm: Ignore received Hard Reset in TOGGLING state
Problem Details: Similar to what fixed in Commit a6fe37f428c1 ("usb: typec: tcpm: Skip hard reset when in error recovery"), the handling of the received Hard Reset has to be skipped during TOGGLING state. [ 4086.021288] VBUS off [ 4086.021295] pending state change SNK_READY -> SNK_UNATTACHED @ 650 ms [rev2 NONE_AMS] [...
```diff diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index be4127ef84e9..5d4da962acc8 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -6174,6 +6174,7 @@ static void _tcpm_pd_hard_reset(struct tcpm_port *port) port->tcpc->set_bist_data(port->tcpc, false)...
e7e921918d905544500ca7a95889f898121ba886
Analyze and fix the following issue in the Linux kernel code: usb: typec: tcpm: fix use-after-free case in tcpm_register_source_caps
Problem Details: There could be a potential use-after-free case in tcpm_register_source_caps(). This could happen when: * new (say invalid) source caps are advertised * the existing source caps are unregistered * tcpm_register_source_caps() returns with an error as usb_power_delivery_register_capabilities() fails...
```diff diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 8a1af08f71b6..be4127ef84e9 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -3014,8 +3014,10 @@ static int tcpm_register_source_caps(struct tcpm_port *port) memcpy(caps.pdo, port->source_caps, siz...
8475ffcfb381a77075562207ce08552414a80326
Analyze and fix the following issue in the Linux kernel code: USB: xen-hcd: Traverse host/ when CONFIG_USB_XEN_HCD is selected
Problem Details: If no other USB HCDs are selected when compiling a small pure virutal machine, the Xen HCD driver cannot be built. Fix it by traversing down host/ if CONFIG_USB_XEN_HCD is selected. Fixes: 494ed3997d75 ("usb: Introduce Xen pvUSB frontend (xen hcd)") Cc: stable@vger.kernel.org # v5.17+ Signed-off-by: ...
```diff diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile index 3a9a0dd4be70..949eca0adebe 100644 --- a/drivers/usb/Makefile +++ b/drivers/usb/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_USB_R8A66597_HCD) += host/ obj-$(CONFIG_USB_FSL_USB2) += host/ obj-$(CONFIG_USB_FOTG210_HCD) += host/ obj-$(CONFIG_USB_MAX3421_...
415ce0ea55c5a3afea501a773e002be9ed7149f5
Analyze and fix the following issue in the Linux kernel code: io_uring/napi: fix timeout calculation
Problem Details: Not quite sure what __io_napi_adjust_timeout() was attemping to do, it's adjusting both the NAPI timeout and the general overall timeout, and calculating a value that is never used. The overall timeout is a super set of the NAPI timeout, and doesn't need adjusting. The only thing we really need to care...
```diff diff --git a/io_uring/napi.c b/io_uring/napi.c index 883a1a665907..8c18ede595c4 100644 --- a/io_uring/napi.c +++ b/io_uring/napi.c @@ -261,12 +261,14 @@ int io_unregister_napi(struct io_ring_ctx *ctx, void __user *arg) } /* - * __io_napi_adjust_timeout() - Add napi id to the busy poll list + * __io_napi_adj...
fbce12d2899c4f19632d85df06c6d9377a565534
Analyze and fix the following issue in the Linux kernel code: arm64: zynqmp: Add coresight cpu debug support
Problem Details: Add coresight debug support to the device tree. This can be useful when panicking, especially when a core is hung in EL3. Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Link: https://lore.kernel.org/r/20240503153422.1958812-1-sean.anderson@linux.dev Signed-off-by: Michal Simek <michal.simek@am...
```diff diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi index dd4569e7bd95..60d1b1acf9a0 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi @@ -70,6 +70,22 @@ clocks = <&zynqmp_clk ACPU>; }; +...
8141b6da1763b9db009e5dcf873869bb31bcef45
Analyze and fix the following issue in the Linux kernel code: regulator: tps6594-regulator: Fix the number of irqs for TPS65224 and TPS6594
Problem Details: The number of irqs is computed to allocate the right amount of memory for the irq data. An array of struct tps6594_regulator_irq_data is allocated one time for all the irqs. Each irq uses one cell of the array. If the computed number of irqs is not correct, not allocated memory could be used. Fix the...
```diff diff --git a/drivers/regulator/tps6594-regulator.c b/drivers/regulator/tps6594-regulator.c index 4a859f4c0f83..ac53792e3fed 100644 --- a/drivers/regulator/tps6594-regulator.c +++ b/drivers/regulator/tps6594-regulator.c @@ -653,18 +653,14 @@ static int tps6594_regulator_probe(struct platform_device *pdev) } ...
ae01e52da244af5d650378ada1bfd2d946dc1b45
Analyze and fix the following issue in the Linux kernel code: serial: drop debugging WARN_ON_ONCE() from uart_write()
Problem Details: syzbot is reporting lockdep warning upon int disc = 7; ioctl(open("/dev/ttyS3", O_RDONLY), TIOCSETD, &disc); sequence. Do like what commit 5f1149d2f4bf ("serial: drop debugging WARN_ON_ONCE() from uart_put_char()") does. Reported-by: syzbot+f78380e4eae53c64125c@syzkaller.appspotmail.com Closes: ...
```diff diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 2c1a0254d3f4..0c4d60976663 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -622,7 +622,7 @@ static ssize_t uart_write(struct tty_struct *tty, const u8 *buf, size_t count) return -EL3...
7a2e8e30ad89f498b206977396d028e10174390a
Analyze and fix the following issue in the Linux kernel code: serial: sc16is7xx: re-add Kconfig SPI or I2C dependency
Problem Details: Commit d49216438139 ("serial: sc16is7xx: split into core and I2C/SPI parts (core)") removed Kconfig SPI_MASTER or I2C dependency for SERIAL_SC16IS7XX (core). This removal was done because I inadvertently misinterpreted some review comments. Because of that, the driver question now pops up if both I2C ...
```diff diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 2a0da35c0ef8..28e4beeabf8f 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -1025,6 +1025,7 @@ config SERIAL_SCCNXP_CONSOLE config SERIAL_SC16IS7XX tristate "NXP SC16IS7xx UART support" + depends on SPI_MA...
4e534ff4b69c6960a165cab2c851b48f0a0da945
Analyze and fix the following issue in the Linux kernel code: serial: sc16is7xx: rename Kconfig CONFIG_SERIAL_SC16IS7XX_CORE
Problem Details: Commit d49216438139 ("serial: sc16is7xx: split into core and I2C/SPI parts (core)") renamed SERIAL_SC16IS7XX_CORE by SERIAL_SC16IS7XX. This means that some configs should have been updated when I submitted the original patch, but unfortunately they were not. Geert mentioned for example: arch/mips/c...
```diff diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 4fdd7857ef4d..2a0da35c0ef8 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -1023,7 +1023,7 @@ config SERIAL_SCCNXP_CONSOLE help Support for console on SCCNXP serial ports. -config SERIAL_SC16IS7XX_CORE...
ca84cd379b45e9b1775b9e026f069a3a886b409d
Analyze and fix the following issue in the Linux kernel code: serial: port: Don't block system suspend even if bytes are left to xmit
Problem Details: Recently, suspend testing on sc7180-trogdor based devices has started to sometimes fail with messages like this: port a88000.serial:0.0: PM: calling pm_runtime_force_suspend+0x0/0xf8 @ 28934, parent: a88000.serial:0 port a88000.serial:0.0: PM: dpm_run_callback(): pm_runtime_force_suspend+0x0/0xf8 ...
```diff diff --git a/drivers/tty/serial/serial_port.c b/drivers/tty/serial/serial_port.c index 91a338d3cb34..d35f1d24156c 100644 --- a/drivers/tty/serial/serial_port.c +++ b/drivers/tty/serial/serial_port.c @@ -64,6 +64,13 @@ static int serial_port_runtime_suspend(struct device *dev) if (port->flags & UPF_DEAD) re...
5208e7ced520a813b4f4774451fbac4e517e78b2
Analyze and fix the following issue in the Linux kernel code: serial: 8250_pxa: Configure tx_loadsz to match FIFO IRQ level
Problem Details: The FIFO is 64 bytes, but the FCR is configured to fire the TX interrupt when the FIFO is half empty (bit 3 = 0). Thus, we should only write 32 bytes when a TX interrupt occurs. This fixes a problem observed on the PXA168 that dropped a bunch of TX bytes during large transmissions. Fixes: ab28f51c77c...
```diff diff --git a/drivers/tty/serial/8250/8250_pxa.c b/drivers/tty/serial/8250/8250_pxa.c index f1a51b00b1b9..ba96fa913e7f 100644 --- a/drivers/tty/serial/8250/8250_pxa.c +++ b/drivers/tty/serial/8250/8250_pxa.c @@ -125,6 +125,7 @@ static int serial_pxa_probe(struct platform_device *pdev) uart.port.iotype = UPIO_M...
2c94512055f362dd789e0f87b8566feeddec83c9
Analyze and fix the following issue in the Linux kernel code: serial: 8250_dw: Revert "Move definitions to the shared header"
Problem Details: This reverts commit d9666dfb314e1ffd6eb9c3c4243fe3e094c047a7. The container of the struct dw8250_port_data is private to the actual driver. In particular, 8250_lpss and 8250_dw use different data types that are assigned to the UART port private_data. Hence, it must not be used outside the specific dri...
```diff diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 667e16897bde..fb809e32c6ae 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -57,6 +57,33 @@ #define DW_UART_QUIRK_APMC0D08 BIT(4) #define DW_UART_QUIRK_CPR_VALUE BIT(5) +struct...
87d80bfbd577912462061b1a45c0ed9c7fcb872f
Analyze and fix the following issue in the Linux kernel code: serial: 8250_dw: Don't use struct dw8250_data outside of 8250_dw
Problem Details: The container of the struct dw8250_port_data is private to the actual driver. In particular, 8250_lpss and 8250_dw use different data types that are assigned to the UART port private_data. Hence, it must not be used outside the specific driver. Currently the only cpr_val is required by the common code...
```diff diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index ba9f4dc4e71d..667e16897bde 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -55,6 +55,7 @@ #define DW_UART_QUIRK_SKIP_SET_RATE BIT(2) #define DW_UART_QUIRK_IS_DMA_FC BIT(3) #defi...
b19ab7ee2c4c1ec5f27c18413c3ab63907f7d55c
Analyze and fix the following issue in the Linux kernel code: tty: n_tty: Fix buffer offsets when lookahead is used
Problem Details: When lookahead has "consumed" some characters (la_count > 0), n_tty_receive_buf_standard() and n_tty_receive_buf_closing() for characters beyond the la_count are given wrong cp/fp offsets which leads to duplicating and losing some characters. If la_count > 0, correct buffer pointers and make count con...
```diff diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index f252d0b5a434..5e9ca4376d68 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -1619,15 +1619,25 @@ static void __receive_buf(struct tty_struct *tty, const u8 *cp, const u8 *fp, else if (ldata->raw || (L_EXTPROC(tty) && !preops)) n_tty_...
526606b0a1998b0791b42c199d53550c3ba724b5
Analyze and fix the following issue in the Linux kernel code: iommu/amd: Fix Invalid wait context issue
Problem Details: With commit c4cb23111103 ("iommu/amd: Add support for enable/disable IOPF") we are hitting below issue. This happens because in IOPF enablement path it holds spin lock with irq disable and then tries to take mutex lock. dmesg: ----- [ 0.938739] ============================= [ 0.938740] [ BUG: In...
```diff diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index 52d83730a22a..c2703599bb16 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2032,7 +2032,6 @@ static int do_attach(struct iommu_dev_data *dev_data, struct protection_domain *domain) { struct amd_iommu *...