id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
de43975721b97283d5f17eea4228faddf08f2681
Analyze and fix the following issue in the Linux kernel code: igc: Fix the typo in the PTM Control macro
Problem Details: The IGC_PTM_CTRL_SHRT_CYC defines the time between two consecutive PTM requests. The bit resolution of this field is six bits. That bit five was missing in the mask. This patch comes to correct the typo in the IGC_PTM_CTRL_SHRT_CYC macro. Fixes: a90ec8483732 ("igc: Add support for PTP getcrosststamp()...
```diff diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h index 44a507029946..2f780cc90883 100644 --- a/drivers/net/ethernet/intel/igc/igc_defines.h +++ b/drivers/net/ethernet/intel/igc/igc_defines.h @@ -546,7 +546,7 @@ #define IGC_PTM_CTRL_START_NOW BIT(29) /* St...
987aae75fc1041072941ffb622b45ce2359a99b9
Analyze and fix the following issue in the Linux kernel code: batman-adv: Hold rtnl lock during MTU update via netlink
Problem Details: The automatic recalculation of the maximum allowed MTU is usually triggered by code sections which are already rtnl lock protected by callers outside of batman-adv. But when the fragmentation setting is changed via batman-adv's own batadv genl family, then the rtnl lock is not yet taken. But dev_set_m...
```diff diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c index ad5714f737be..6efbc9275aec 100644 --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c @@ -495,7 +495,10 @@ static int batadv_netlink_set_mesh(struct sk_buff *skb, struct genl_info *info) attr = info->attrs[BATADV_ATTR_FRAGMENTAT...
b888c510f7b3d64ca75fc0f43b4a4bd1a611312f
Analyze and fix the following issue in the Linux kernel code: igb: Avoid starting unnecessary workqueues
Problem Details: If ptp_clock_register() fails or CONFIG_PTP isn't enabled, avoid starting PTP related workqueues. In this way we can fix this: BUG: unable to handle page fault for address: ffffc9000440b6f8 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 100000067 P4D 1000...
```diff diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c index 405886ee5261..319c544b9f04 100644 --- a/drivers/net/ethernet/intel/igb/igb_ptp.c +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c @@ -1385,18 +1385,6 @@ void igb_ptp_init(struct igb_adapter *adapter) return; ...
c275a176e4b69868576e543409927ae75e3a3288
Analyze and fix the following issue in the Linux kernel code: can: raw: add missing refcount for memory leak fix
Problem Details: Commit ee8b94c8510c ("can: raw: fix receiver memory leak") introduced a new reference to the CAN netdevice that has assigned CAN filters. But this new ro->dev reference did not maintain its own refcount which lead to another KASAN use-after-free splat found by Eric Dumazet. This patch ensures a proper...
```diff diff --git a/net/can/raw.c b/net/can/raw.c index e10f59375659..d50c3f3d892f 100644 --- a/net/can/raw.c +++ b/net/can/raw.c @@ -85,6 +85,7 @@ struct raw_sock { int bound; int ifindex; struct net_device *dev; + netdevice_tracker dev_tracker; struct list_head notifier; int loopback; int recv_own_msgs; ...
0bfe71159230bab79ee230225ae12ffecbb69f3e
Analyze and fix the following issue in the Linux kernel code: can: isotp: fix support for transmission of SF without flow control
Problem Details: The original implementation had a very simple handling for single frame transmissions as it just sent the single frame without a timeout handling. With the new echo frame handling the echo frame was also introduced for single frames but the former exception ('simple without timers') has been maintaine...
```diff diff --git a/net/can/isotp.c b/net/can/isotp.c index 99770ed28531..f02b5d3e4733 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -188,12 +188,6 @@ static bool isotp_register_rxid(struct isotp_sock *so) return (isotp_bc_flags(so) == 0); } -static bool isotp_register_txecho(struct isotp_sock *so) -{ - /...
bf23ffc8a9a777dfdeb04232e0946b803adbb6a9
Analyze and fix the following issue in the Linux kernel code: bnx2x: new flag for track HW resource allocation
Problem Details: While injecting PCIe errors to the upstream PCIe switch of a BCM57810 NIC, system hangs/crashes were observed. After several calls to bnx2x_tx_timout() complete, bnx2x_nic_unload() is called to free up HW resources and bnx2x_napi_disable() is called to release NAPI objects. Later, when the EEH driver ...
```diff diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index 8bcde0a6e011..e2a4e1088b7f 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h @@ -1508,6 +1508,8 @@ struct bnx2x { bool cnic_loaded; struct c...
29d67fdebc42af6466d1909c60fdd1ef4f3e5240
Analyze and fix the following issue in the Linux kernel code: libbpf: Free btf_vmlinux when closing bpf_object
Problem Details: I hit a memory leak when testing bpf_program__set_attach_target(). Basically, set_attach_target() may allocate btf_vmlinux, for example, when setting attach target for bpf_iter programs. But btf_vmlinux is freed only in bpf_object_load(), which means if we only open bpf object but not load it, setting ...
```diff diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index b8afe2f5bc93..4c3967d94b6d 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -8423,6 +8423,7 @@ void bpf_object__close(struct bpf_object *obj) bpf_object__elf_finish(obj); bpf_object_unload(obj); btf__free(obj->btf); + bt...
66fbfb35da47f391bdadf9fa7ceb88af4faa9022
Analyze and fix the following issue in the Linux kernel code: clk: Fix slab-out-of-bounds error in devm_clk_release()
Problem Details: Problem can be reproduced by unloading snd_soc_simple_card, because in devm_get_clk_from_child() devres data is allocated as `struct clk`, but devm_clk_release() expects devres data to be `struct devm_clk_state`. KASAN report: ================================================================== BUG: K...
```diff diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c index 4fb4fd4b06bd..737aa70e2cb3 100644 --- a/drivers/clk/clk-devres.c +++ b/drivers/clk/clk-devres.c @@ -205,18 +205,19 @@ EXPORT_SYMBOL(devm_clk_put); struct clk *devm_get_clk_from_child(struct device *dev, struct device_node *np, cons...
e0d25c591ac676ece0e1ad6bbd72a159b9355598
Analyze and fix the following issue in the Linux kernel code: drm/i915: fix Sphinx indentation warning
Problem Details: Fix Sphinx warning about unexpected indent. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Luca Coelho <luciano.coelho@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230621123156.14907-2-jani.nikula@intel.com (cherry picked from commit 175b036472f678948b03baabce4a008...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c b/drivers/gpu/drm/i915/gt/uc/intel_huc.c index ddd146265beb..fa70defcb5b2 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c @@ -26,6 +26,7 @@ * The kernel driver is only responsible for loading the HuC firmware ...
c35f3aa34509085bfc9800c86bc9998f8954933d
Analyze and fix the following issue in the Linux kernel code: RISC-V: vector: export VLENB csr in __sc_riscv_v_state
Problem Details: VLENB is critical for callers of ptrace to reconstruct Vector register files from the register dump of NT_RISCV_VECTOR. Also, future systems may will have a writable VLENB, so add it now to potentially save future compatibility issue. Fixes: 0c59922c769a ("riscv: Add ptrace vector support") Signed-off...
```diff diff --git a/arch/riscv/include/asm/vector.h b/arch/riscv/include/asm/vector.h index 3d78930cab51..c5ee07b3df07 100644 --- a/arch/riscv/include/asm/vector.h +++ b/arch/riscv/include/asm/vector.h @@ -70,8 +70,9 @@ static __always_inline void __vstate_csr_save(struct __riscv_v_ext_state *dest) "csrr %1, " __st...
e3f9324b231aba1dc707572bfe80be210c2d4cbd
Analyze and fix the following issue in the Linux kernel code: RISC-V: Remove ptrace support for vectors
Problem Details: We've found two bugs here: NT_RISCV_VECTOR steps on NT_RISCV_CSR (which is only for embedded), and we don't have vlenb in the core dumps. Given that we've have a pair of bugs croup up as part of the GDB review we've probably got other issues, so let's just cut this for 6.5 and get it right. Fixes: 0c...
```diff diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c index 1d572cf3140f..487303e3ef22 100644 --- a/arch/riscv/kernel/ptrace.c +++ b/arch/riscv/kernel/ptrace.c @@ -25,9 +25,6 @@ enum riscv_regset { #ifdef CONFIG_FPU REGSET_F, #endif -#ifdef CONFIG_RISCV_ISA_V - REGSET_V, -#endif }; static...
60dd283804479c4a52f995b713f448e2cd65b8c8
Analyze and fix the following issue in the Linux kernel code: cpufreq: amd-pstate-ut: Fix kernel panic when loading the driver
Problem Details: After loading the amd-pstate-ut driver, amd_pstate_ut_check_perf() and amd_pstate_ut_check_freq() use cpufreq_cpu_get() to get the policy of the CPU and mark it as busy. In these functions, cpufreq_cpu_put() should be used to release the policy, but it is not, so any other entity trying to access the ...
```diff diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c index cf07ee77d3cc..502d494499ae 100644 --- a/drivers/cpufreq/amd-pstate-ut.c +++ b/drivers/cpufreq/amd-pstate-ut.c @@ -140,7 +140,7 @@ static void amd_pstate_ut_check_perf(u32 index) if (ret) { amd_pstate_ut_cases[index].re...
8d6e5e8268e89979d86501dbb8385ce2e6154de1
Analyze and fix the following issue in the Linux kernel code: cpufreq: amd-pstate-ut: Remove module parameter access
Problem Details: In amd-pstate-ut, shared memory-based systems call get_shared_mem() as part of amd_pstate_ut_check_enabled() function. This function was written when CONFIG_X86_AMD_PSTATE was tristate config and amd_pstate can be built as a module. Currently CONFIG_X86_AMD_PSTATE is a boolean config and module parame...
```diff diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c index 7f3fe2048981..cf07ee77d3cc 100644 --- a/drivers/cpufreq/amd-pstate-ut.c +++ b/drivers/cpufreq/amd-pstate-ut.c @@ -64,27 +64,9 @@ static struct amd_pstate_ut_struct amd_pstate_ut_cases[] = { static bool get_shared_mem(void) { ...
7a46404b3c01e61807f69a02c81a9e3f3a1b9b0f
Analyze and fix the following issue in the Linux kernel code: perf lzma: Convert some pr_err() to pr_debug() as callers already use pr_debug()
Problem Details: I noticed some error with: # perf list ex_ret_brn lzma: fopen failed on /usr/lib/modules/5.15.14-100.fc34.x86_64/kernel/net/bluetooth/bnep/bnep.ko.xz: 'No such file or directory' lzma: fopen failed on /usr/lib/modules/5.16.16-200.fc35.x86_64/kernel/drivers/gpu/drm/drm_kms_helper.ko.xz: 'No such ...
```diff diff --git a/tools/perf/util/lzma.c b/tools/perf/util/lzma.c index 51424cdc3b68..af9a97612f9d 100644 --- a/tools/perf/util/lzma.c +++ b/tools/perf/util/lzma.c @@ -45,15 +45,13 @@ int lzma_decompress_to_file(const char *input, int output_fd) infile = fopen(input, "rb"); if (!infile) { - pr_err("lzma: fope...
fbc5bc4c8e6ca6f5720798c96107307906dc49c0
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add test for bpf_obj_drop with bad reg->off
Problem Details: Add a selftest for the fix provided in the previous commit. Without the fix, the selftest passes the verifier while it should fail. The special logic for detecting graph root or node for reg->off and bypassing reg->off == 0 guarantee for release helpers/kfuncs has been dropped. Signed-off-by: Kumar Ka...
```diff diff --git a/tools/testing/selftests/bpf/progs/local_kptr_stash_fail.c b/tools/testing/selftests/bpf/progs/local_kptr_stash_fail.c index 5484d1e9801d..fcf7a7567da2 100644 --- a/tools/testing/selftests/bpf/progs/local_kptr_stash_fail.c +++ b/tools/testing/selftests/bpf/progs/local_kptr_stash_fail.c @@ -62,4 +62,...
6785b2edf48c6b1c3ea61fe3b0d2e02b8fbf90c0
Analyze and fix the following issue in the Linux kernel code: bpf: Fix check_func_arg_reg_off bug for graph root/node
Problem Details: The commit being fixed introduced a hunk into check_func_arg_reg_off that bypasses reg->off == 0 enforcement when offset points to a graph node or root. This might possibly be done for treating bpf_rbtree_remove and others as KF_RELEASE and then later check correct reg->off in helper argument checks. ...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 3a91bfd7b9cc..3d51c737a034 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -7973,17 +7973,6 @@ int check_func_arg_reg_off(struct bpf_verifier_env *env, if (arg_type_is_dynptr(arg_type) && type == PTR_TO_STACK) return 0; ...
9e261e6da0a814f4ee1856ab06b19c25190aeffb
Analyze and fix the following issue in the Linux kernel code: wifi: Fix ieee80211.h kernel-doc issues
Problem Details: The kernel-doc script identified multiple issues in ieee80211.h, so fix them. In the process update some references to the latest applicable specification. include/linux/ieee80211.h:848: warning: Function parameter or member 'count' not described in 'ieee80211_quiet_ie' include/linux/ieee80211.h:848: ...
```diff diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 4b998090898e..bd2f6e19c357 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -836,9 +836,14 @@ enum ieee80211_preq_target_flags { }; /** - * struct ieee80211_quiet_ie + * struct ieee80211_quiet_ie - Quiet elemen...
1b78dd34560e9962f8e917fe4adde6f2ab0eb89f
Analyze and fix the following issue in the Linux kernel code: Revert "wifi: mac80211_hwsim: check the return value of nla_put_u32"
Problem Details: This reverts commit b970ac68e0c4 ("wifi: mac80211_hwsim: check the return value of nla_put_u32") since it introduced a memory leak in the error path, which seems worse than sending an incomplete skb, and the put can't fail anyway since the SKB was just allocated. Signed-off-by: Johannes Berg <johannes...
```diff diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index ec78fe13dd3e..1f524030b186 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -582,9 +582,8 @@ static int mac80211_hwsim_vendor_cmd_test...
a7a2ef0c4b3efbd7d6f3fabd87dbbc0b3f2de5af
Analyze and fix the following issue in the Linux kernel code: mac80211: make ieee80211_tx_info padding explicit
Problem Details: While looking at a bug, I got rather confused by the layout of the 'status' field in ieee80211_tx_info. Apparently, the intention is that status_driver_data[] is used for driver specific data, and fills up the size of the union to 40 bytes, just like the other ones. This is indeed what actually happen...
```diff diff --git a/include/net/mac80211.h b/include/net/mac80211.h index d7fa0a55067e..f1420e5af5de 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1192,9 +1192,11 @@ struct ieee80211_tx_info { u8 ampdu_ack_len; u8 ampdu_len; u8 antenna; + u8 pad; u16 tx_time; u8 flags; - ...
c6662a4b3ecf03aa832125e9705a185402cd3b17
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: fix kernel-doc notation warning
Problem Details: Add description for struct member 'agg' to prevent a kernel-doc warning. mac80211.h:2289: warning: Function parameter or member 'agg' not described in 'ieee80211_link_sta' Fixes: 4c51541ddb78 ("wifi: mac80211: keep A-MSDU data in sta and per-link") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> ...
```diff diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 3a8a2d2c58c3..d7fa0a55067e 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -2259,6 +2259,7 @@ struct ieee80211_sta_aggregates { * @he_cap: HE capabilities of this STA * @he_6ghz_capa: on 6 GHz, holds the HE 6 GHz band cap...
266a5cd768da7e243cd26bc6840ce48cad1c907e
Analyze and fix the following issue in the Linux kernel code: wifi: radiotap: fix kernel-doc notation warnings
Problem Details: Fix a typo (82011 -> 80211) to prevent a kernel-doc warning. Add one missing function parameter description to prevent a kernel-doc warning. ieee80211_radiotap.h:52: warning: expecting prototype for struct ieee82011_radiotap_header. Prototype was for struct ieee80211_radiotap_header instead ieee80211_...
```diff diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h index c4722a9963de..2338f8d2a8b3 100644 --- a/include/net/ieee80211_radiotap.h +++ b/include/net/ieee80211_radiotap.h @@ -21,7 +21,7 @@ #include <asm/unaligned.h> /** - * struct ieee82011_radiotap_header - base radiotap header ...
a49a0d4e573e22f47218668ee4137cdcdc391652
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: remove dead/unused enum value
Problem Details: Drop an unused (extra) enum value to prevent a kernel-doc warning. cfg80211.h:1492: warning: Excess enum value 'STATION_PARAM_APPLY_STA_TXPOWER' description in 'station_parameters_apply_mask' Fixes: 2d8b08fef0af ("wifi: cfg80211: fix kernel-doc warnings all over the file") Signed-off-by: Randy Dunlap...
```diff diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 070ac0c62bd4..3a4b684f89bf 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1482,7 +1482,6 @@ struct iface_combination_params { * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) * @STATION_PA...
1dcf396b4223143fcd3ef6d5e2acdbb6f7bea2e5
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: improve documentation for flag fields
Problem Details: Fix and hopefully improve documentation for 'flag' fields of a few types by adding references to relevant enumerations. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Link: https://lore.kernel.org/r/20230713132957.275859-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg <johannes.berg@intel.com>
```diff diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 423fe9b85cb0..070ac0c62bd4 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -263,7 +263,7 @@ enum ieee80211_privacy { * are only for driver use when pointers to this structure are * passed around. * - * @flags: rate-spec...
f14cef00456fb7cd6d2ca7389c149b5f079f0091
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: Remove unused function declarations
Problem Details: Commit 685429623f88 ("mac80211: Fix circular locking dependency in ARP filter handling") left the ieee80211_set_arp_filter() declaration unused. And commit 164eb02d070a ("mac80211: add radar detection command/event") introducted ieee80211_dfs_cac_timer() declaration but never implemented it. Signed-of...
```diff diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 91633a0b723e..06bd406846d2 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1872,7 +1872,6 @@ void ieee80211_send_pspoll(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata); void ieee80...
7bdfda42f043fce2e590252f264e0832b31a3e92
Analyze and fix the following issue in the Linux kernel code: wifi: wext: Remove unused declaration dev_get_wireless_info()
Problem Details: Commit 556829657397 ("[NL80211]: add netlink interface to cfg80211") declared but never implemented this, remove it. Commit 11433ee450eb ("[WEXT]: Move to net/wireless") rename net/core/wireless.c to net/wireless/wext.c, then commit 3d23e349d807 ("wext: refactor") refactor wext.c to wext-core.c, fix th...
```diff diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index d2ea5863eedc..b2cf243ebe44 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h @@ -426,17 +426,10 @@ struct iw_public_data { /**************************** PROTOTYPES ****************************/ /* - * Functions part of...
218d690c49b7e9c94ad0d317adbdd4af846ea0dc
Analyze and fix the following issue in the Linux kernel code: wifi: nl80211/cfg80211: add forgotten nla_policy for BSS color attribute
Problem Details: The previous commit dd3e4fc75b4a ("nl80211/cfg80211: add BSS color to NDP ranging parameters") adds a parameter for NDP ranging by introducing a new attribute type named NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR. However, the author forgot to also describe the nla_policy at nl80211_pmsr_ftm_req_attr_policy ...
```diff diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 0ffebf1a1eb6..de47838aca4f 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -323,6 +323,7 @@ nl80211_pmsr_ftm_req_attr_policy[NL80211_PMSR_FTM_REQ_ATTR_MAX + 1] = { [NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED] = { .type = NLA_F...
927521170c4a18c620f97865f7bad48f17c48967
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: fix puncturing bitmap handling in CSA
Problem Details: Code inspection reveals that we switch the puncturing bitmap before the real channel switch, since that happens only in the second round of the worker after the channel context is switched by ieee80211_link_use_reserved_context(). Fixes: 2cc25e4b2a04 ("wifi: mac80211: configure puncturing bitmap") Sig...
```diff diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 953f24166ffc..45e7a5d9c7d9 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3648,12 +3648,6 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata) lockdep_assert_held(&local->mtx); lockdep_assert_held(&local->chanctx...
fba360a047d5eeeb9d4b7c3a9b1c8308980ce9a6
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211_hwsim: drop short frames
Problem Details: While technically some control frames like ACK are shorter and end after Address 1, such frames shouldn't be forwarded through wmediumd or similar userspace, so require the full 3-address header to avoid accessing invalid memory if shorter frames are passed in. Reported-by: syzbot+b2645b5bf1512b81fa22...
```diff diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index f446fd0e8cd0..dd516cec4197 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -5626,14 +5626,15 @@ static int hwsim_cloned_frame_receive...
67dfa589aa8806c7959cbca2f4613b8d41c75a06
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: check for station first in client probe
Problem Details: When probing a client, first check if we have it, and then check for the channel context, otherwise you can trigger the warning there easily by probing when the AP isn't even started yet. Since a client existing means the AP is also operating, we can then keep the warning. Also simplify the moved code...
```diff diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index e7ac24603892..953f24166ffc 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -4133,19 +4133,20 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev, mutex_lock(&local->mtx); rcu_read_lock(); + sta = sta_info_g...
abc76cf552e13cfa88a204b362a86b0e08e95228
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: ocb: don't leave if not joined
Problem Details: If there's no OCB state, don't ask the driver/mac80211 to leave, since that's just confusing. Since set/clear the chandef state, that's a simple check. Reported-by: syzbot+09d1cd2f71e6dd3bfd2c@syzkaller.appspotmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
```diff diff --git a/net/wireless/ocb.c b/net/wireless/ocb.c index 27a1732264f9..29afaf3da54f 100644 --- a/net/wireless/ocb.c +++ b/net/wireless/ocb.c @@ -68,6 +68,9 @@ int __cfg80211_leave_ocb(struct cfg80211_registered_device *rdev, if (!rdev->ops->leave_ocb) return -EOPNOTSUPP; + if (!wdev->u.ocb.chandef.chan...
5d4e04bf3a0f098bd9033de3a5291810fa14c7a6
Analyze and fix the following issue in the Linux kernel code: wifi: cfg80211: reject auth/assoc to AP with our address
Problem Details: If the AP uses our own address as its MLD address or BSSID, then clearly something's wrong. Reject such connections so we don't try and fail later. Reported-by: syzbot+2676771ed06a6df166ad@syzkaller.appspotmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
```diff diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index ac059cefbeb3..775cac4d6100 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c @@ -281,6 +281,11 @@ int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev, ether_addr_equal(req->bss->bssid, wdev->u.client.connected_addr)) retur...
5f55836ab41671e005038255fdd60482718d2ca2
Analyze and fix the following issue in the Linux kernel code: PM: QoS: Add check to make sure CPU latency is non-negative
Problem Details: CPU latency should never be negative, which will be incorrectly high when converted to unsigned data type. Commit 8d36694245f2 ("PM: QoS: Add check to make sure CPU freq is non-negative") makes sure CPU frequency is non-negative to fix incorrect behavior in freqency QoS. Add an analogous check to mak...
```diff diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 782d3b41c1f3..4244b069442e 100644 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -220,6 +220,11 @@ static struct pm_qos_constraints cpu_latency_constraints = { .type = PM_QOS_MIN, }; +static inline bool cpu_latency_qos_value_invalid(s32 value...
f96801f0cfcefc0a16b146596577c53c75ee9773
Analyze and fix the following issue in the Linux kernel code: thermal/of: Fix potential uninitialized value access
Problem Details: If of_parse_phandle_with_args() called from __thermal_of_bind() or __thermal_of_unbind() fails, cooling_spec.np will not be initialized, so move the of_node_put() calls below the respective return value checks to avoid dereferencing an uninitialized pointer. Fixes: 3fd6d6e2b4e8 ("thermal/of: Rework th...
```diff diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 330690a3a208..4ca905723429 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -291,13 +291,13 @@ static int __thermal_of_unbind(struct device_node *map_np, int index, int trip_i ret = of_parse_phandle_w...
8884ba07786c718771cf7b78cb3024924b27ec2b
Analyze and fix the following issue in the Linux kernel code: apparmor: fix invalid reference on profile->disconnected
Problem Details: profile->disconnected was storing an invalid reference to the disconnected path. Fix it by duplicating the string using aa_unpack_strdup and freeing accordingly. Fixes: 72c8a768641d ("apparmor: allow profiles to provide info to disconnected paths") Signed-off-by: Georgia Garcia <georgia.garcia@canonic...
```diff diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 4817c1b30105..d7525f228c43 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -255,6 +255,7 @@ void aa_free_profile(struct aa_profile *profile) aa_put_ns(profile->ns); kfree_sensitive(profile->rename); + kf...
642265e22ecc7fe05c49cb8e1e0000a049df9857
Analyze and fix the following issue in the Linux kernel code: vfio/pds: Send type for SUSPEND_STATUS command
Problem Details: Commit bb500dbe2ac6 ("vfio/pds: Add VFIO live migration support") added live migration support for the pds-vfio-pci driver. When sending the SUSPEND command to the device, the driver sets the type of suspend (i.e. P2P or FULL). However, the driver isn't sending the type of suspend for the SUSPEND_STATU...
```diff diff --git a/drivers/vfio/pci/pds/cmds.c b/drivers/vfio/pci/pds/cmds.c index b0d88442b091..36463ccc3df9 100644 --- a/drivers/vfio/pci/pds/cmds.c +++ b/drivers/vfio/pci/pds/cmds.c @@ -86,12 +86,13 @@ void pds_vfio_unregister_client_cmd(struct pds_vfio_pci_device *pds_vfio) } static int -pds_vfio_suspend_wait...
b2edc4148ad90c906275329711810721719a0c2d
Analyze and fix the following issue in the Linux kernel code: drm/i915/guc: Force a reset on internal GuC error
Problem Details: If GuC hits an internal error (and survives long enough to report it to the KMD), it is basically toast and will stop until a GT reset and subsequent GuC reload is performed. Previously, the KMD just printed an error message and then waited for the heartbeat to eventually kick in and trigger a reset (a...
```diff diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c index 861d0c58388c..27df41c53b89 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c @@ -159,6 +159,21 @@ static void gen11_disable_guc_interrupts(struct intel_guc *guc) ge...
6dc5774deefe38d9ab385a5dafbe6614ae63d166
Analyze and fix the following issue in the Linux kernel code: sfc: allocate a big enough SKB for loopback selftest packet
Problem Details: Cited commits passed a size to alloc_skb that was only big enough for the actual packet contents, but the following skb_put + memcpy writes the whole struct efx_loopback_payload including leading and trailing padding bytes (which are then stripped off with skb_pull/skb_trim). This could cause an skb...
```diff diff --git a/drivers/net/ethernet/sfc/falcon/selftest.c b/drivers/net/ethernet/sfc/falcon/selftest.c index cf1d67b6d86d..c3dc88e6c26c 100644 --- a/drivers/net/ethernet/sfc/falcon/selftest.c +++ b/drivers/net/ethernet/sfc/falcon/selftest.c @@ -428,7 +428,7 @@ static int ef4_begin_loopback(struct ef4_tx_queue *tx...
770c69f037c18cfaa37c3d6c6ef8bd257635513f
Analyze and fix the following issue in the Linux kernel code: interconnect: Add debugfs test client
Problem Details: It's often useful during test, debug, and development to issue path votes from shell. Add a debugfs client for this purpose. Example usage: cd /sys/kernel/debug/interconnect/test-client/ # Configure node endpoints for the path from CPU to DDR on # qcom/sm8550. echo chm_apps > src_node echo ebi >...
```diff diff --git a/Documentation/driver-api/interconnect.rst b/Documentation/driver-api/interconnect.rst index 5ed4f57a6bac..a92d0f277a1f 100644 --- a/Documentation/driver-api/interconnect.rst +++ b/Documentation/driver-api/interconnect.rst @@ -113,3 +113,28 @@ through dot to generate diagrams in many graphical forma...
44f0fb8dfe263e27ac95d502a58586fe95fd5958
Analyze and fix the following issue in the Linux kernel code: leds: trigger: netdev: rename 'hw_control' sysfs entry to 'offloaded'
Problem Details: Commit b655892ffd6d ("leds: trigger: netdev: expose hw_control status via sysfs") exposed to sysfs the flag that tells whether the LED trigger is offloaded to hardware, under the name "hw_control", since that is the name under which this setting is called in the code. Everywhere else in kernel when so...
```diff diff --git a/Documentation/ABI/testing/sysfs-class-led-trigger-netdev b/Documentation/ABI/testing/sysfs-class-led-trigger-netdev index 78b62a23b14a..f6d9d72ce77b 100644 --- a/Documentation/ABI/testing/sysfs-class-led-trigger-netdev +++ b/Documentation/ABI/testing/sysfs-class-led-trigger-netdev @@ -13,7 +13,7 @@...
604204fcb321abe81238551936ecda5269e81076
Analyze and fix the following issue in the Linux kernel code: net: ethernet: mtk_eth_soc: fix NULL pointer on hw reset
Problem Details: When a hardware reset is triggered on devices not initializing WED the calls to mtk_wed_fe_reset and mtk_wed_fe_reset_complete dereference a pointer on uninitialized stack memory. Break out of both functions in case a hw_list entry is 0. Fixes: 08a764a7c51b ("net: ethernet: mtk_wed: add reset/reset_co...
```diff diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c index 985cff910f30..3b651efcc25e 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed.c +++ b/drivers/net/ethernet/mediatek/mtk_wed.c @@ -221,9 +221,13 @@ void mtk_wed_fe_reset(void) for (i = 0; i < ARRAY_SIZE(hw_li...
b4e9fa933551e51459c634dc4396171dc65284a6
Analyze and fix the following issue in the Linux kernel code: drm/nouveau: uvmm: fix unset region pointer on remap
Problem Details: Transfer the region pointer of a uvma to the new uvma(s) on re-map to prevent potential shader faults when the re-mapped uvma(s) are unmapped. Signed-off-by: Danilo Krummrich <dakr@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230820222...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c index 3a1e8538f205..aae780e4a4aa 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c @@ -639,6 +639,7 @@ nouveau_uvmm_sm_prepare(struct nouveau_uvmm *uvmm, struct drm_gpu...
ab6c637ad0276e42f8acabcbc64932a6d346dab3
Analyze and fix the following issue in the Linux kernel code: bpf: Fix a bpf_kptr_xchg() issue with local kptr
Problem Details: When reviewing local percpu kptr support, Alexei discovered a bug wherea bpf_kptr_xchg() may succeed even if the map value kptr type and locally allocated obj type do not match ([1]). Missed struct btf_id comparison is the reason for the bug. This patch added such struct btf_id comparison and will flag...
```diff diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 4ccca1f6c998..3a91bfd7b9cc 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -4990,20 +4990,22 @@ static int map_kptr_match_type(struct bpf_verifier_env *env, struct bpf_reg_state *reg, u32 regno) { const char *targ_n...
5a7693e6bbf19b22fd6c1d2c4b7beb0a03969e2c
Analyze and fix the following issue in the Linux kernel code: ntb: Fix calculation ntb_transport_tx_free_entry()
Problem Details: ntb_transport_tx_free_entry() never returns 0 with the current calculation. If head == tail, then it would return qp->tx_max_entry. Change compare to tail >= head and when they are equal, a 0 would be returned. Fixes: e74bfeedad08 ("NTB: Add flow control to the ntb_netdev") Reviewed-by: Logan Gunthorp...
```diff diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index 7884ea9c7643..9532108d2dce 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -2429,7 +2429,7 @@ unsigned int ntb_transport_tx_free_entry(struct ntb_transport_qp *qp) unsigned int head = qp->tx_index; uns...
f195a1a6fe416882984f8bd6c61afc1383171860
Analyze and fix the following issue in the Linux kernel code: ntb: Drop packets when qp link is down
Problem Details: Currently when the transport receive packets after netdev has closed the transport returns error and triggers tx errors to be incremented and carrier to be stopped. There is no reason to return error if the device is already closed. Drop the packet and return 0. Fixes: e26a5843f7f5 ("NTB: Split ntb_hw...
```diff diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index 3e7a6a8a9c87..7884ea9c7643 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -2283,9 +2283,13 @@ int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, struct ntb_queue_entry *entr...
cc79bd2738c2d40aba58b2be6ce47dc0e471df0e
Analyze and fix the following issue in the Linux kernel code: ntb: Clean up tx tail index on link down
Problem Details: The tx tail index is not reset when the link goes down. This causes the tail index to go out of sync when the link goes down and comes back up. Refactor the ntb_qp_link_down_reset() and reset the tail index as well. Fixes: 2849b5d70641 ("NTB: Reset transport QP link stats on down") Reported-by: Yuan Y...
```diff diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index 2abd2235bbca..3e7a6a8a9c87 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -909,7 +909,7 @@ static int ntb_set_mw(struct ntb_transport_ctx *nt, int num_mw, return 0; } -static void ntb_qp_link_down_re...
6f20d3261265885f6a6be4cda49d7019728760e0
Analyze and fix the following issue in the Linux kernel code: HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode()
Problem Details: Presently, if a call to logi_dj_recv_send_report() fails, we do not learn about the error until after sending short HID_OUTPUT_REPORT with hid_hw_raw_request(). To handle this somewhat unlikely issue, return on error in logi_dj_recv_send_report() (minding ugly sleep workaround) and take into account th...
```diff diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c index fef67da0de53..8afe3be683ba 100644 --- a/drivers/hid/hid-logitech-dj.c +++ b/drivers/hid/hid-logitech-dj.c @@ -1285,6 +1285,9 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev, * 50 msec should gives...
f2ac6402760a1a6a7595df7f7182fe9f1c833503
Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix TLB-Invalidation seqno store
Problem Details: When getting the next gt's seqno to be stored into an objects mm.tlb[gt_id] array, fix the retrieval code to get it from the correct gt instead of the same one. Fixes: d6c531ab4820 ("drm/i915: Invalidate the TLBs on each GT") Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com> Reviewed-by:...
```diff diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index e52089564d79..6f180ee13853 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -1356,7 +1356,7 @@ void vma_invalidate_tlb(struct i915_address_space *vm, u32 *tlb) */ for_each_gt(gt, vm->i9...
e1dd7bc93029024af5688253b0c05181d6e01f8e
Analyze and fix the following issue in the Linux kernel code: blk-mq: fix tags leak when shrink nr_hw_queues
Problem Details: Although we don't need to realloc set->tags[] when shrink nr_hw_queues, we need to free them. Or these tags will be leaked. How to reproduce: 1. mount -t configfs configfs /mnt 2. modprobe null_blk nr_devices=0 submit_queues=8 3. mkdir /mnt/nullb/nullb0 4. echo 1 > /mnt/nullb/nullb0/power 5. echo 4 > ...
```diff diff --git a/block/blk-mq.c b/block/blk-mq.c index 687ec3f4f10d..afad6d06eaf7 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4379,9 +4379,13 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set, int new_nr_hw_queues) { struct blk_mq_tags **new_tags; + int i; - if (set->nr_...
8b9aee8073a5f3e0c2e418d45a7969270ea576c6
Analyze and fix the following issue in the Linux kernel code: dmaengine: fsl-edma: fix build error when arch is s390
Problem Details: fixed build error reported by kernel test robot. >> s390-linux-ld: fsl-edma-main.c:(.text+0xf4c): undefined reference to `devm_platform_ioremap_resource' s390-linux-ld: drivers/dma/idma64.o: in function `idma64_platform_probe': Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.ke...
```diff diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index 1d485fce91c8..f52d36e713f3 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -211,6 +211,7 @@ config FSL_DMA config FSL_EDMA tristate "Freescale eDMA engine support" depends on OF + depends on HAS_IOMEM select DMA_ENGINE select DM...
ed7c6a2ba6a682f191f289de01e8eb0a1366c3eb
Analyze and fix the following issue in the Linux kernel code: dt-bindings: regulator: qcom,rpmh-regulator: allow i, j, l, m & n as RPMh resource name suffix
Problem Details: Add "i", "j", "l", "m" and "n" to the allowed subffix list as they can be used as RPMh resource name suffixes on new platforms. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230822-topic-sm8x50-upstream-rp...
```diff diff --git a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml index e758093365bc..127a6f39b7f0 100644 --- a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml +++ b/Documentation/devicetree/bindings/regu...
d3c2245754220b0fd4c6868e2fe48741a734be58
Analyze and fix the following issue in the Linux kernel code: RDMA/mlx5: Fix trailing */ formatting in block comment
Problem Details: Resolved a formatting issue where the trailing */ in a block comment was placed on a same line instead of separate line. Signed-off-by: Rohit Chavan <roheetchavan@gmail.com> Link: https://lore.kernel.org/r/20230822120451.8215-1-roheetchavan@gmail.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
```diff diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 92f35fafb2c0..3e345ef380f1 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -1235,7 +1235,8 @@ static struct mlx5_ib_mr *reg_create(struct ib_pd *pd, struct ib_umem *umem, } /* The pg_...
6812e06999054792e13193666989dbdc01642625
Analyze and fix the following issue in the Linux kernel code: RDMA/rxe: Fix redundant break statement in switch-case.
Problem Details: Removed unreachable break statement after return. Signed-off-by: Rohit Chavan <roheetchavan@gmail.com> Link: https://lore.kernel.org/r/20230822091304.7312-1-roheetchavan@gmail.com Acked-by: Zhu Yanjun <zyjzyj2000@gmail.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
```diff diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index 903f0b71447e..48f86839d36a 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.c +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c @@ -798,7 +798,6 @@ static int init_send_wr(struct rxe_qp *qp, struct rxe_send_wr *wr, rx...
dc202c57e9a1423aed528e4b8dc949509cd32191
Analyze and fix the following issue in the Linux kernel code: RDMA/efa: Fix wrong resources deallocation order
Problem Details: When trying to destroy QP or CQ, we first decrease the refcount and potentially free memory regions allocated for the object and then request the device to destroy the object. If the device fails, the object isn't fully destroyed so the user/IB core can try to destroy the object again which will lead t...
```diff diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c index 7a27d79c0541..0f8ca99d0827 100644 --- a/drivers/infiniband/hw/efa/efa_verbs.c +++ b/drivers/infiniband/hw/efa/efa_verbs.c @@ -453,12 +453,12 @@ int efa_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata) ibde...
b83eb8ba2ab9551217ed36320b8999db2f351e57
Analyze and fix the following issue in the Linux kernel code: phy: qcom-qmp-combo: fix clock probing
Problem Details: During rebase of qcom-qmp-combo series a call to devm_clk_bulk_get_all() got moved by git from qmp_combo_parse_dt_legacy() to phy_dp_clks_register(). This doesn't have any serious effect, since the clocks will be set in both legacy and non-legacy paths. However let's move it back to place anyway, to pr...
```diff diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index 9c3de41ecedb..cbb28afce135 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -3067,12 +3067,6 @@ static int phy_dp_clks_register(struct qmp_combo *qmp,...
bee024d20451e4ce04ea30099cad09f7f75d288b
Analyze and fix the following issue in the Linux kernel code: RDMA/siw: Correct wrong debug message
Problem Details: We need to print num_sle first then pbl->max_buf per the condition. Also replace mem->pbl with pbl while at it. Fixes: 303ae1cdfdf7 ("rdma/siw: application interface") Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev> Link: https://lore.kernel.org/r/20230821133255.31111-3-guoqing.jiang@linux.dev ...
```diff diff --git a/drivers/infiniband/sw/siw/siw_verbs.c b/drivers/infiniband/sw/siw/siw_verbs.c index fadfa70853f3..fdbef3254e30 100644 --- a/drivers/infiniband/sw/siw/siw_verbs.c +++ b/drivers/infiniband/sw/siw/siw_verbs.c @@ -1494,7 +1494,7 @@ int siw_map_mr_sg(struct ib_mr *base_mr, struct scatterlist *sl, int nu...
b056327bee09e6b86683d3f709a438ccd6031d72
Analyze and fix the following issue in the Linux kernel code: RDMA/siw: Balance the reference of cep->kref in the error path
Problem Details: The siw_connect can go to err in below after cep is allocated successfully: 1. If siw_cm_alloc_work returns failure. In this case socket is not assoicated with cep so siw_cep_put can't be called by siw_socket_disassoc. We need to call siw_cep_put twice since cep->kref is increased once after it was in...
```diff diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c index da530c0404da..a2605178f4ed 100644 --- a/drivers/infiniband/sw/siw/siw_cm.c +++ b/drivers/infiniband/sw/siw/siw_cm.c @@ -1501,7 +1501,6 @@ error: cep->cm_id = NULL; id->rem_ref(id); - siw_cep_put(cep); qp->ce...
86f703762a9b6c1a8e3ce9fd62fd5353379be3a0
Analyze and fix the following issue in the Linux kernel code: phy: qcom-qmp-pcie: keep offset tables sorted
Problem Details: In order to simplify adding new PHY configurations, keep register offset structs sorted by the version. Fixes: a05b6d5135ec ("phy: qcom-qmp-pcie: add support for sa8775p") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20230820142035.89903-5-dmitry.barysh...
```diff diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index 373f959e439d..cdee109c398d 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -2323,17 +2323,6 @@ static const struct qmp_pcie_offsets qmp_pcie_offsets_v5 =...
cfe0d203813420e643db08264679982a31fea95c
Analyze and fix the following issue in the Linux kernel code: phy: qcom-qmp-pcie: drop ln_shrd from v5_20 config
Problem Details: There is no shared lane config for v5.20 PHYs, it is only present on SM8550 gen4x2. Fixes: a05b6d5135ec ("phy: qcom-qmp-pcie: add support for sa8775p") Cc: Mrinmay Sarkar <quic_msarkar@quicinc.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/2023082014...
```diff diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index e15ea113b2db..373f959e439d 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -2342,7 +2342,6 @@ static const struct qmp_pcie_offsets qmp_pcie_offsets_v5_20...
dfe261107c080709459c32695847eec96238852b
Analyze and fix the following issue in the Linux kernel code: Revert "IB/isert: Fix incorrect release of isert connection"
Problem Details: Commit: 699826f4e30a ("IB/isert: Fix incorrect release of isert connection") is causing problems on OPA when DEVICE_REMOVAL is happening. ------------[ cut here ]------------ WARNING: CPU: 52 PID: 2117247 at drivers/infiniband/core/cq.c:359 ib_cq_pool_cleanup+0xac/0xb0 [ib_core] Modules linked in: ...
```diff diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 92e1e7587af8..00a7303c8cc6 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -2570,6 +2570,8 @@ static void isert_wait_conn(struct iscsit_conn *conn) isert_p...
fe6518d547fc52ba74201018dc9aeb364072ac78
Analyze and fix the following issue in the Linux kernel code: misc: fastrpc: Pass proper scm arguments for static process init
Problem Details: Memory is allocated for dynamic loading when audio daemon is trying to attach to audioPD on DSP side. This memory is allocated from reserved CMA memory region and needs ownership assignment to new VMID in order to use it from audioPD. In the current implementation, arguments are not correctly passed t...
```diff diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 0b376d9a2744..a66b7c111cd5 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1325,13 +1325,18 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl, return 0; err_invoke: if (fl->cctx->vmcount) { - str...
a2cb9cd6a3949a3804ad9fd7da234892ce6719ec
Analyze and fix the following issue in the Linux kernel code: misc: fastrpc: Fix incorrect DMA mapping unmap request
Problem Details: Scatterlist table is obtained during map create request and the same table is used for DMA mapping unmap. In case there is any failure while getting the sg_table, ERR_PTR is returned instead of sg_table. When the map is getting freed, there is only a non-NULL check of sg_table which will also be true ...
```diff diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 7d8818a4089f..0b376d9a2744 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -757,6 +757,7 @@ static int fastrpc_map_create(struct fastrpc_user *fl, int fd, { struct fastrpc_session_ctx *sess = fl->sctx; struct fastrpc_map...
ada6c2d99aedd1eac2f633d03c652e070bc2ea74
Analyze and fix the following issue in the Linux kernel code: misc: fastrpc: Fix remote heap allocation request
Problem Details: Remote heap is used by DSP audioPD on need basis. This memory is allocated from reserved CMA memory region and is then shared with audioPD to use it for it's functionality. Current implementation of remote heap is not allocating the memory from CMA region, instead it is allocating the memory from SMMU...
```diff diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 1c7c0532da6f..7d8818a4089f 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1867,7 +1867,11 @@ static int fastrpc_req_mmap(struct fastrpc_user *fl, char __user *argp) return -EINVAL; } - err = fastrpc_buf_alloc(fl, fl-...
ffc1786c3f4174b9e44a537cb1cecb7ba6b756ff
Analyze and fix the following issue in the Linux kernel code: phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning
Problem Details: 'soc_id' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: phy-meson-g12a-usb2.c:322:17: error: cast to smaller integer type 'enum meson_soc_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Revie...
```diff diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c index a628c59e5cf0..0e0b5c00b676 100644 --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c @@ -319,7 +319,7 @@ static int phy_meson_g12a_usb2_probe(struct platform_devi...
e312cbdc11305568554a9e18a2ea5c2492c183f3
Analyze and fix the following issue in the Linux kernel code: amba: bus: fix refcount leak
Problem Details: commit 5de1540b7bc4 ("drivers/amba: create devices from device tree") increases the refcount of of_node, but not releases it in amba_device_release, so there is refcount leak. By using of_node_put to avoid refcount leak. Fixes: 5de1540b7bc4 ("drivers/amba: create devices from device tree") Signed-off-...
```diff diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index ce88af9eb562..09e72967b8ab 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -528,6 +528,7 @@ static void amba_device_release(struct device *dev) { struct amba_device *d = to_amba_device(dev); + of_node_put(d->dev.of_node); if (d->res.p...
f6f0d97b2cbffa9dd7908faa516f3bdf56c8de2b
Analyze and fix the following issue in the Linux kernel code: staging: greybus: fix alignment of open parenthesis
Problem Details: Fixed all CHECK: Alignment should match open parenthesis as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Rohit Chavan <roheetchavan@gmail.com> Link: https://lore.kernel.org/r/20230822080213.6757-1-roheetchavan@gmail.com Signed-off-by: Greg Kroah-Hartman ...
```diff diff --git a/drivers/staging/greybus/fw-core.c b/drivers/staging/greybus/fw-core.c index 57bebf24636b..0fb15a60412f 100644 --- a/drivers/staging/greybus/fw-core.c +++ b/drivers/staging/greybus/fw-core.c @@ -89,7 +89,7 @@ static int gb_fw_core_probe(struct gb_bundle *bundle, } connection = gb_connectio...
72eb8304b283dde4e6d9c223662cba447b17ce2f
Analyze and fix the following issue in the Linux kernel code: staging: sm750fb: fix sii164InitChip function name
Problem Details: Adhere to Linux Kernel coding style. Found by checkpatch. Signed-off-by: Abdel Alkuor <alkuor@gmail.com> Link: https://lore.kernel.org/r/ZNvITXcfVwpJAh6y@abdel Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index e0c7ff3352bf..8b81e8642f9e 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -14,7 +14,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { #ifdef DVI_...
1bff15cd9f12e9d713dfd07b73540e04cb29fa3a
Analyze and fix the following issue in the Linux kernel code: staging: vme_user: fix check lines should not end with a '('
Problem Details: Fixed all CHECK: Lines should not end with a '(' as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira <alexondunkan@gmail.com> Link: https://lore.kernel.org/r/ZNqbDtRjGWq67lDJ@alolivei-thinkpadt480s.gru.csb Signed-off-by: Greg Kroah-Hartman <g...
```diff diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c index bbf82b1be9f1..d0366dd3f2b1 100644 --- a/drivers/staging/vme_user/vme.c +++ b/drivers/staging/vme_user/vme.c @@ -1267,9 +1267,8 @@ void vme_bus_error_handler(struct vme_bridge *bridge, } EXPORT_SYMBOL(vme_bus_error_handler); -...
03d593732dbc51d76a15c0b8e1f07af9b027ff1e
Analyze and fix the following issue in the Linux kernel code: staging: vme_user: fix check blank lines not necessary
Problem Details: Fixed all CHECK: Blank lines aren't necessary after an open brace '{' and CHECK: Blank lines aren't necessary before a close brace '}' as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira <alexondunkan@gmail.com> Link: https://lore.kernel.org/...
```diff diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c index 5eb0d780c77f..bbf82b1be9f1 100644 --- a/drivers/staging/vme_user/vme.c +++ b/drivers/staging/vme_user/vme.c @@ -308,7 +308,6 @@ struct vme_resource *vme_slave_request(struct vme_dev *vdev, u32 address, if (((slave_image->addre...
6a8326494551cc634fc191f9db83deca389209ed
Analyze and fix the following issue in the Linux kernel code: staging: vt6655: Change camel case variables to snake case
Problem Details: Change camel case to snake case and remove the unneeded "by" prefix. Issue found by checkpatch. Signed-off-by: Mingzai Sun <szp2017@gmail.com> Link: https://lore.kernel.org/r/20230812151710.462685-1-szp2017@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/staging/vt6655/srom.c b/drivers/staging/vt6655/srom.c index ee5ca4db74dc..1b89d401a7eb 100644 --- a/drivers/staging/vt6655/srom.c +++ b/drivers/staging/vt6655/srom.c @@ -49,7 +49,7 @@ * Parameters: * In: * iobase - I/O base address - * byContntOffset - address of ...
6edb4ba6fb5b946d112259f54f4657f82eb71e89
Analyze and fix the following issue in the Linux kernel code: wifi: ath9k: fix parameter check in ath9k_init_debug()
Problem Details: Make IS_ERR() judge the debugfs_create_dir() function return in ath9k_init_debug() Signed-off-by: Minjie Du <duminjie@vivo.com> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20230712114740.13226-1-duminjie@vivo.com
```diff diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index fb7a2952d0ce..995c6e705637 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c @@ -1420,7 +1420,7 @@ int ath9k_init_debug(struct ath_hw *ah) sc->debug.debugfs_phy =...
454994cfa9e4c18b6df9f78b60db8eadc20a6c25
Analyze and fix the following issue in the Linux kernel code: wifi: ath9k: protect WMI command response buffer replacement with a lock
Problem Details: If ath9k_wmi_cmd() has exited with a timeout, it is possible that during next ath9k_wmi_cmd() call the wmi_rsp callback for previous wmi command writes to new wmi->cmd_rsp_buf and makes a completion. This results in an invalid ath9k_wmi_cmd() return value. Move the replacement of WMI command response ...
```diff diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c index 04f363cb90fe..1476b42b52a9 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.c +++ b/drivers/net/wireless/ath/ath9k/wmi.c @@ -283,7 +283,8 @@ int ath9k_wmi_connect(struct htc_target *htc, struct wmi *wmi, static int ...
b674fb513e2e7a514fcde287c0f73915d393fdb6
Analyze and fix the following issue in the Linux kernel code: wifi: ath9k: fix races between ath9k_wmi_cmd and ath9k_wmi_ctrl_rx
Problem Details: Currently, the synchronization between ath9k_wmi_cmd() and ath9k_wmi_ctrl_rx() is exposed to a race condition which, although being rather unlikely, can lead to invalid behaviour of ath9k_wmi_cmd(). Consider the following scenario: CPU0 CPU1 ath9k_wmi_cmd(...) mutex_lock(&wmi->op_mutex) ath9...
```diff diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c index d652c647d56b..04f363cb90fe 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.c +++ b/drivers/net/wireless/ath/ath9k/wmi.c @@ -242,10 +242,10 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb, spin_unlo...
4b91dcc2f601cc2098b5fead71344704ddcff8b7
Analyze and fix the following issue in the Linux kernel code: Documentation: devices.txt: Fix minors for ttyCPM*
Problem Details: ttyCPM* devices belong to CPM_UART driver at the first place and that driver provides 6 ports. Fixes: e29c3f81eb89 ("Documentation: devices.txt: reconcile serial/ucc_uart minor numers") Cc: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Reviewed-by: ...
```diff diff --git a/Documentation/admin-guide/devices.txt b/Documentation/admin-guide/devices.txt index 1ba5b7c4973c..839054923530 100644 --- a/Documentation/admin-guide/devices.txt +++ b/Documentation/admin-guide/devices.txt @@ -2691,7 +2691,7 @@ 45 = /dev/ttyMM1 Marvell MPSC - port 1 (obsolete unused) 46 = ...
27681960f05515555441d7bf58d565cbc68137f3
Analyze and fix the following issue in the Linux kernel code: Documentation: devices.txt: Remove ttySIOC*
Problem Details: IOC3 serial driver was removed, remove associated devices from documentation. Fixes: 9c860e4cf708 ("tty/serial: remove the ioc3_serial driver") Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/f13b5c64f8cb6d8f2357d7be14397...
```diff diff --git a/Documentation/admin-guide/devices.txt b/Documentation/admin-guide/devices.txt index 75a408f72402..1ba5b7c4973c 100644 --- a/Documentation/admin-guide/devices.txt +++ b/Documentation/admin-guide/devices.txt @@ -2694,9 +2694,6 @@ 49 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 3 82 = /dev/ttyV...
e327fdc262345ca37b358a51ff0c0046ab1b8d15
Analyze and fix the following issue in the Linux kernel code: Documentation: devices.txt: Remove ttyIOC*
Problem Details: IOC4 serial driver was removed, remove associated devices from documentation. Fixes: a017ef17cfd8 ("tty/serial: remove the ioc4_serial driver") Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/b5deb1222eb92017f0efe5b5cae12...
```diff diff --git a/Documentation/admin-guide/devices.txt b/Documentation/admin-guide/devices.txt index b1b57f638b94..75a408f72402 100644 --- a/Documentation/admin-guide/devices.txt +++ b/Documentation/admin-guide/devices.txt @@ -2692,14 +2692,8 @@ 46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) - port 0 ... 49...
9baeea723c0fb9c3ba9a336369f758ed9bc6831d
Analyze and fix the following issue in the Linux kernel code: serial: sc16is7xx: fix bug when first setting GPIO direction
Problem Details: When configuring a pin as an output pin with a value of logic 0, we end up as having a value of logic 1 on the output pin. Setting a logic 0 a second time (or more) after that will correctly output a logic 0 on the output pin. By default, all GPIO pins are configured as inputs. When we enter sc16is7xx...
```diff diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index b45e34e3910d..cfc88959b2f7 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1342,9 +1342,18 @@ static int sc16is7xx_gpio_direction_output(struct gpio_chip *chip, state |= BIT(offset); else...
0499942928341d572a42199580433c2b0725211e
Analyze and fix the following issue in the Linux kernel code: serial: sc16is7xx: fix regression with GPIO configuration
Problem Details: Commit 679875d1d880 ("sc16is7xx: Separate GPIOs from modem control lines") and commit 21144bab4f11 ("sc16is7xx: Handle modem status lines") changed the function of the GPIOs pins to act as modem control lines without any possibility of selecting GPIO function. As a consequence, applications that depen...
```diff diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 93b4137daa8b..b45e34e3910d 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -236,7 +236,8 @@ /* IOControl register bits (Only 750/760) */ #define SC16IS7XX_IOCONTROL_LATCH_BIT (1 << 0) /* En...
2861ed4d6e6d1a2c9de9bf5b0abd996c2dc673d0
Analyze and fix the following issue in the Linux kernel code: serial: sc16is7xx: fix broken port 0 uart init
Problem Details: The sc16is7xx_config_rs485() function is called only for the second port (index 1, channel B), causing initialization problems for the first port. For the sc16is7xx driver, port->membase and port->mapbase are not set, and their default values are 0. And we set port->iobase to the device index. This me...
```diff diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 18a48ce052c2..ffe817309413 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1438,6 +1438,12 @@ static int sc16is7xx_probe(struct device *dev, s->p[i].port.fifosize = SC16IS7XX_FIFO_SIZE; ...
5abd01145d0cc6cd1b7c2fe6ee0b9ea0fa13671e
Analyze and fix the following issue in the Linux kernel code: serial: tegra: handle clk prepare error in tegra_uart_hw_init()
Problem Details: In tegra_uart_hw_init(), the return value of clk_prepare_enable() should be checked since it might fail. Fixes: e9ea096dd225 ("serial: tegra: add serial driver") Signed-off-by: Yi Yang <yiyang13@huawei.com> Link: https://lore.kernel.org/r/20230817105406.228674-1-yiyang13@huawei.com Signed-off-by: Greg...
```diff diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c index 0b597b282fce..d4ec943cb8e9 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -996,7 +996,11 @@ static int tegra_uart_hw_init(struct tegra_uart_port *tup) tup->ier_shadow = 0; tup-...
b99f51ba04035b2394cae008f9ac09563b012307
Analyze and fix the following issue in the Linux kernel code: tty: n_gsm: increase malformed counter for malformed control frames
Problem Details: The malformed counter in gsm_mux is already increased in case of errors detected in gsm_queue() and gsm1_receive(). gsm_dlci_command() also detects a case for a malformed frame but does not increase the malformed counter yet. Fix this by also increasing the gsm_mux malformed counter in case of a malfo...
```diff diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 68276a7e62a0..2dc5bf14da2d 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2455,8 +2455,10 @@ static void gsm_dlci_command(struct gsm_dlci *dlci, const u8 *data, int len) data += dlen; /* Malformed command? */ - if (clen > len) + ...
e1c90bbb5f5178967d5d3c0917de847e88ebe398
Analyze and fix the following issue in the Linux kernel code: tty: n_gsm: remove unneeded initialization of ret in gsm_dlci_config
Problem Details: The variable 'ret' is not used before assignment from gsm_activate_mux(). Still it gets initialized to zero at declaration. Fix this as remarked in the link below by moving the declaration to the first assignment. Link: https://lore.kernel.org/all/b42bc4d1-cc9d-d115-c981-aaa053bdc59f@kernel.org/ Sig...
```diff diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 27da795ca348..a4df0a20f212 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3280,7 +3280,6 @@ static void gsm_copy_config_values(struct gsm_mux *gsm, static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c) { - int ret = 0; ...
901de5ac0ea92c63c4cd7be60f9ccbbacd623a3c
Analyze and fix the following issue in the Linux kernel code: tty: n_gsm: add missing description to structs in gsmmux.h
Problem Details: Currently, all available structure fields in gsmmux.h except those for gsm_config are commented. Furthermore, no kernel doc comments are used. Fix this by adding appropriate comments to the not commented fields of gsm_config. Convert the comments of the other structs to kernel doc format. Note that '...
```diff diff --git a/include/uapi/linux/gsmmux.h b/include/uapi/linux/gsmmux.h index e56e2d7ea6eb..3bd6f03a8293 100644 --- a/include/uapi/linux/gsmmux.h +++ b/include/uapi/linux/gsmmux.h @@ -18,6 +18,28 @@ */ #define GSM_FL_RESTART _BITUL(0) +/** + * struct gsm_config - n_gsm basic configuration parameters + * + *...
aa222dd190d69ca8e0e2b990ec171c67a74d5383
Analyze and fix the following issue in the Linux kernel code: netfilter: xtables: refactor deprecated strncpy
Problem Details: Prefer `strscpy_pad` as it's a more robust interface whilst maintaing zero-padding behavior. There may have existed a bug here due to both `tbl->repl.name` and `info->name` having a size of 32 as defined below: | #define XT_TABLE_MAXNAMELEN 32 This may lead to buffer overreads in some situations -- ...
```diff diff --git a/net/netfilter/xt_repldata.h b/net/netfilter/xt_repldata.h index 68ccbe50bb1e..5d1fb7018dba 100644 --- a/net/netfilter/xt_repldata.h +++ b/net/netfilter/xt_repldata.h @@ -29,7 +29,7 @@ if (tbl == NULL) \ return NULL; \ term = (struct type##_error *)&(((char *)tbl)[term_offset]); \ - strncpy(t...
a7ed3465daa240bdf01a5420f64336fee879c09d
Analyze and fix the following issue in the Linux kernel code: netfilter: ebtables: fix fortify warnings in size_entry_mwt()
Problem Details: When compiling with gcc 13 and CONFIG_FORTIFY_SOURCE=y, the following warning appears: In function ‘fortify_memcpy_chk’, inlined from ‘size_entry_mwt’ at net/bridge/netfilter/ebtables.c:2118:2: ./include/linux/fortify-string.h:592:25: error: call to ‘__read_overflow2_field’ declared with attribute...
```diff diff --git a/include/uapi/linux/netfilter_bridge/ebtables.h b/include/uapi/linux/netfilter_bridge/ebtables.h index a494cf43a755..b0caad82b693 100644 --- a/include/uapi/linux/netfilter_bridge/ebtables.h +++ b/include/uapi/linux/netfilter_bridge/ebtables.h @@ -182,12 +182,14 @@ struct ebt_entry { unsigned char ...
691b2bf1494620ff8c292626e4967c57e5705a8b
Analyze and fix the following issue in the Linux kernel code: bonding: update port speed when getting bond speed
Problem Details: Andrew reported a bonding issue that if we put an active-back bond on top of a 802.3ad bond interface. When the 802.3ad bond's speed/duplex changed dynamically. The upper bonding interface's speed/duplex can't be changed at the same time, which will show incorrect speed. Fix it by updating the port sp...
```diff diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index f398bec78457..ed7212e61c54 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -5718,6 +5718,7 @@ static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev, */ bond_for_each_s...
04bbe863241a9be7d57fb4cf217ee4a72f480e70
Analyze and fix the following issue in the Linux kernel code: PCI: hv: Fix a crash in hv_pci_restore_msi_msg() during hibernation
Problem Details: When a Linux VM with an assigned PCI device runs on Hyper-V, if the PCI device driver is not loaded yet (i.e. MSI-X/MSI is not enabled on the device yet), doing a VM hibernation triggers a panic in hv_pci_restore_msi_msg() -> msi_lock_descs(&pdev->dev), because pdev->dev.msi.data is still NULL. Avoid ...
```diff diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 2d93d0c4f10d..bed3cefdaf19 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -3983,6 +3983,9 @@ static int hv_pci_restore_msi_msg(struct pci_dev *pdev, void *arg) struct msi...
2f4926723ac7343ae11861d0ba2aaa8e04bd3ca1
Analyze and fix the following issue in the Linux kernel code: tty: gdm724x: use min_t() for size_t varable and a constant
Problem Details: My thinking was that ulong is the same as size_t everywhere. No, size_t is uint on 32bit. So the below commit introduced a build warning on 32bit: .../gdm724x/gdm_tty.c:165:24: warning: comparison of distinct pointer types ('typeof (2048UL) *' (aka 'unsigned long *') and 'typeof (remain) *' (aka 'unsig...
```diff diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c index 67d9bf41e836..32b2e817ff04 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -17,9 +17,9 @@ #define GDM_TTY_MAJOR 0 #define GDM_TTY_MINOR 32 -#define WRITE_SIZE 2048UL +#define WR...
52ecf812de2548ea0704e67f99cea1d0f3b8b173
Analyze and fix the following issue in the Linux kernel code: usb: gadget: udc-xilinx: fix incorrect type in assignment warning
Problem Details: The bitwise attribute is used by the sparse utility to make sure the variable is converted to the local processor type before other (unsafe) operations are performed on the variable. Fix the below sparse warnings type casted with __le16: warning: incorrect type in assignment (different base types) ...
```diff diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index eb06b4234267..56b8286a8009 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -1636,7 +1636,7 @@ static void xudc_getstatus(struct xusb_udc *udc) } req->usb_req.length = ...
0411fa8a5f655ebc0753e718fdfe68bc66a756f0
Analyze and fix the following issue in the Linux kernel code: usb: gadget: udc-xilinx: fix cast from restricted __le16 warning
Problem Details: usb_ctrlrequest member wValue, wLength and wIndex are of type __le16, conversion macro cpu_to_le16() input argument is __u16, so properly typecasted to fix the cast from restricted __le16 warning. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/all/202209020044.CX2PfZzM-...
```diff diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index e5029dd3becd..eb06b4234267 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -1755,9 +1755,9 @@ static void xudc_handle_setup(struct xusb_udc *udc) memcpy(&setup, ep0rambase...
7f93e683bc0667a6b5e0da4b49fa07938a9ccad4
Analyze and fix the following issue in the Linux kernel code: usb: gadget: udc-xilinx: fix restricted __le16 degrades to integer warning
Problem Details: usb_ctrlrequest members wValue and wIndex are of type __le16, so to fix this warnings we are using le16_to_cpu() macros. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/all/202209020044.CX2PfZzM-lkp@intel.com/ Signed-off-by: Piyush Mehta <piyush.mehta@amd.com> Link: http...
```diff diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index f301b09bf3f8..e5029dd3becd 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -1615,13 +1615,13 @@ static void xudc_getstatus(struct xusb_udc *udc) case USB_RECIP_INTERFACE: ...
23e60c8daf5ec2ab1b731310761b668745fcf6ed
Analyze and fix the following issue in the Linux kernel code: usb: typec: tcpci: clear the fault status bit
Problem Details: According the "USB Type-C Port Controller Interface Specification v2.0" the TCPC sets the fault status register bit-7 (AllRegistersResetToDefault) once the registers have been reset to their default values. This triggers an alert(-irq) on PTN5110 devices albeit we do mask the fault-irq, which may caus...
```diff diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c index fc708c289a73..0ee3e6e29bb1 100644 --- a/drivers/usb/typec/tcpm/tcpci.c +++ b/drivers/usb/typec/tcpm/tcpci.c @@ -602,6 +602,10 @@ static int tcpci_init(struct tcpc_dev *tcpc) if (time_after(jiffies, timeout)) return -ETIMEDOU...
f23643306430f86e2f413ee2b986e0773e79da31
Analyze and fix the following issue in the Linux kernel code: usb: typec: bus: verify partner exists in typec_altmode_attention
Problem Details: Some usb hubs will negotiate DisplayPort Alt mode with the device but will then negotiate a data role swap after entering the alt mode. The data role swap causes the device to unregister all alt modes, however the usb hub will still send Attention messages even after failing to reregister the Alt Mode....
```diff diff --git a/drivers/usb/typec/bus.c b/drivers/usb/typec/bus.c index fe5b9a2e61f5..e95ec7e382bb 100644 --- a/drivers/usb/typec/bus.c +++ b/drivers/usb/typec/bus.c @@ -183,12 +183,20 @@ EXPORT_SYMBOL_GPL(typec_altmode_exit); * * Notifies the partner of @adev about Attention command. */ -void typec_altmode_...
1fa206bb764f37d2ab4bf671e483153ef0659b34
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: meson-g12a: do post init to fix broken usb after resumption
Problem Details: Device connected to usb otg port of GXL-based boards can not be recognised after resumption, doesn't recover even if disconnect and reconnect the device. dmesg shows it disconnects during resumption. [ 41.492911] usb 1-2: USB disconnect, device number 3 [ 41.499346] usb 1-2: unregistering device [...
```diff diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c index e99c7489dba0..2c07c038b584 100644 --- a/drivers/usb/dwc3/dwc3-meson-g12a.c +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c @@ -926,6 +926,12 @@ static int __maybe_unused dwc3_meson_g12a_resume(struct device *dev) return ret;...
26f4f8358d89c0d9972a30abdb3f3a425ef49e38
Analyze and fix the following issue in the Linux kernel code: dt-bindings: usb: samsung,exynos-dwc3: Fix Exynos5433 compatible
Problem Details: The correct compatible for Exynos5433 is "samsung,exynos5433-dwusb3". Fix the typo in its usage. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Fixes: 949ea75b7ba4 ("dt-bindings: usb: samsung,exynos-dwc3: convert to dtschema") Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org...
```diff diff --git a/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml b/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml index e61badb61b35..deeed2bca2cd 100644 --- a/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/samsung,exynos-dwc...
8d4ff1351801bd646c9fed7aedb9705250f2c87b
Analyze and fix the following issue in the Linux kernel code: dt-bindings: usb: samsung,exynos-dwc3: fix order of clocks on Exynos5433
Problem Details: The Exynos5433 DTSI had always different order of DWC USB3 controller clocks than the binding. The order in the binding was introduced in the commit 949ea75b7ba4 ("dt-bindings: usb: samsung,exynos-dwc3: convert to dtschema") converting to DT schema. The Linux driver does not care about order and was ...
```diff diff --git a/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml b/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml index 42ceaf13cd5d..e61badb61b35 100644 --- a/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/samsung,exynos-dwc...
c02d35d89b317994bd713ba82e160c5e7f22d9c8
Analyze and fix the following issue in the Linux kernel code: btrfs: zoned: skip splitting and logical rewriting on pre-alloc write
Problem Details: When doing a relocation, there is a chance that at the time of btrfs_reloc_clone_csums(), there is no checksum for the corresponding region. In this case, btrfs_finish_ordered_zoned()'s sum points to an invalid item and so ordered_extent's logical is set to some invalid value. Then, btrfs_lookup_block...
```diff diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index a2f8e7440f8c..09bc325d075d 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -1700,10 +1700,21 @@ void btrfs_finish_ordered_zoned(struct btrfs_ordered_extent *ordered) { struct btrfs_inode *inode = BTRFS_I(ordered->inode); struct btrfs_fs_info *f...
19e4a47ee74718a22e963e8a647c8c3bfe8bb05c
Analyze and fix the following issue in the Linux kernel code: wifi: mac80211: check S1G action frame size
Problem Details: Before checking the action code, check that it even exists in the frame. Reported-by: syzbot+be9c824e6f269d608288@syzkaller.appspotmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
```diff diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 4f707d2a160f..33f9764b94de 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -3732,6 +3732,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) break; goto queue; case WLAN_CATEGORY_S1G: + if (len < offsetofend(typeof(*mgmt), + ...
9c319a0f6d52a8ad1364884b3baff57676f26de8
Analyze and fix the following issue in the Linux kernel code: drm/ttm/tests: Fix type conversion in ttm_pool_test
Problem Details: Fix a warning about casting an integer of different size in ttm_pool_alloc_basic_dma_addr() subtest. Cast the DMA address to uintptr_t before casting it to a generic pointer. Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com> Cc: Christian König <christian.koenig@amd.com> Reported-by: kern...
```diff diff --git a/drivers/gpu/drm/ttm/tests/ttm_pool_test.c b/drivers/gpu/drm/ttm/tests/ttm_pool_test.c index 8d90870fb199..2d9cae8cd984 100644 --- a/drivers/gpu/drm/ttm/tests/ttm_pool_test.c +++ b/drivers/gpu/drm/ttm/tests/ttm_pool_test.c @@ -228,8 +228,8 @@ static void ttm_pool_alloc_basic_dma_addr(struct kunit *t...
d5301c90716a8e20bc961a348182daca00c8e8f0
Analyze and fix the following issue in the Linux kernel code: pinctrl: cherryview: fix address_space_handler() argument
Problem Details: First argument of acpi_*_address_space_handler() APIs is acpi_handle of the device, which is incorrectly passed in driver ->remove() path here. Fix it by passing the appropriate argument and while at it, make both API calls consistent using ACPI_HANDLE(). Fixes: a0b028597d59 ("pinctrl: cherryview: Add...
```diff diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 55a42dbf97b6..81ee949b946d 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -1649,7 +1649,6 @@ static int chv_pinctrl_probe(struct platform_device...
220adc0fda6bbc274fff5825e2fd7d3dcd719e5c
Analyze and fix the following issue in the Linux kernel code: ASoC: fsl: merge DAI call back functions into ops
Problem Details: ALSA SoC merges DAI call backs into .ops. This patch merge these into one. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202308152047.psX1QNDh-lkp@intel.com/ Cc: Randy Dunlap <rdunlap@infradead.org> Fixes: 446b31e89493 ("ASoC: soc-dai.h: remove unused cal...
```diff diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c index 40a4a2667394..1671bcd4ee3d 100644 --- a/sound/soc/fsl/mpc5200_psc_ac97.c +++ b/sound/soc/fsl/mpc5200_psc_ac97.c @@ -222,6 +222,7 @@ static int psc_ac97_probe(struct snd_soc_dai *cpu_dai) * psc_ac97_dai_template: template CP...