id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
b5b52de3214a29911f949459a79f6640969b5487
Analyze and fix the following issue in the Linux kernel code: fscache: Fix oops due to race with cookie_lru and use_cookie
Problem Details: If a cookie expires from the LRU and the LRU_DISCARD flag is set, but the state machine has not run yet, it's possible another thread can call fscache_use_cookie and begin to use it. When the cookie_worker finally runs, it will see the LRU_DISCARD flag set, transition the cookie->state to LRU_DISCARDI...
```diff diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c index 451d8a077e12..bce2492186d0 100644 --- a/fs/fscache/cookie.c +++ b/fs/fscache/cookie.c @@ -605,6 +605,14 @@ again: set_bit(FSCACHE_COOKIE_DO_PREP_TO_WRITE, &cookie->flags); queue = true; } + /* + * We could race with cookie_lru which may ...
098e5edc5d048a8df8691fd9fde895af100be42b
Analyze and fix the following issue in the Linux kernel code: media: videobuf2-core: take mmap_lock in vb2_get_unmapped_area()
Problem Details: While vb2_mmap took the mmap_lock mutex, vb2_get_unmapped_area didn't. Add this. Also take this opportunity to move the 'q->memory != VB2_MEMORY_MMAP' check and vb2_fileio_is_active() check into __find_plane_by_offset() so both vb2_mmap and vb2_get_unmapped_area do the same checks. Since q->memory is...
```diff diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index ab9697f3b5f1..92efc4676df6 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -813,7 +813,13 @@ int vb2_core_reqbufs(struct vb2_...
11c7f9e3131ad14b27a957496088fa488b153a48
Analyze and fix the following issue in the Linux kernel code: remoteproc: core: Do pm_relax when in RPROC_OFFLINE state
Problem Details: Make sure that pm_relax() happens even when the remoteproc is stopped before the crash handler work is scheduled. Signed-off-by: Maria Yu <quic_aiquny@quicinc.com> Cc: stable <stable@vger.kernel.org> Fixes: a781e5aa5911 ("remoteproc: core: Prevent system suspend during remoteproc recovery") Link: http...
```diff diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 11c165ddf1fc..1cd4815a6dd1 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1868,12 +1868,18 @@ static void rproc_crash_handler_work(struct work_struct *work) mutex_...
81ed7d9de18768fe0cb3d74a7a163a8c082e1346
Analyze and fix the following issue in the Linux kernel code: ASoC: codecs: wcd-clsh: Remove the unused function
Problem Details: The function wcd_clsh_set_buck_mode() is defined in the wcd-clsh-v2.c file, but not called elsewhere, so remove this unused function. sound/soc/codecs/wcd-clsh-v2.c:133:20: warning: unused function 'wcd_clsh_enable_status'. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3348 Reported-by: Abaci ...
```diff diff --git a/sound/soc/codecs/wcd-clsh-v2.c b/sound/soc/codecs/wcd-clsh-v2.c index 4c7ebc7fb400..a75db27e5205 100644 --- a/sound/soc/codecs/wcd-clsh-v2.c +++ b/sound/soc/codecs/wcd-clsh-v2.c @@ -130,12 +130,6 @@ static inline void wcd_enable_clsh_block(struct wcd_clsh_ctrl *ctrl, ctrl->clsh_users = 0; } -...
40c3012205b68b53f20d20b9c34b570094d083f4
Analyze and fix the following issue in the Linux kernel code: drm/i915/backlight: convert DRM_DEBUG_KMS() to drm_dbg_kms()
Problem Details: Fix the final straggler. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/4769f8377be11536bd19840a2e59ef9f8c0a558c.1670405587.git.jani.nikula@intel.com
```diff diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c index 3ed5c64c3816..5b7da72c95b8 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_backlight.c @@ -866,8 +866,8 @@ static int intel_backlight_device_upd...
aeffc8fb2174f017a10df114bc312f899904dc68
Analyze and fix the following issue in the Linux kernel code: drm/amd/display: fix array index out of bound error in DCN32 DML
Problem Details: [Why&How] LinkCapacitySupport array is indexed with the number of voltage states and not the number of max DPPs. Fix the error by changing the array declaration to use the correct (larger) array size of total number of voltage states. Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Reviewed...
```diff diff --git a/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h b/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h index 630f3395e90a..a0207a8f8756 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h +++ b/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.h @@ -1153,7 +1153,7 @@ struct ...
bc21fe9a5844c5bc8f7ec319b11d2671a94eb867
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/sdma_v4_0: turn off SDMA ring buffer in the s2idle suspend
Problem Details: In the SDMA s0ix save process requires to turn off SDMA ring buffer for avoiding the SDMA in-flight request, otherwise will suffer from SDMA page fault which causes by page request from in-flight SDMA ring accessing at SDMA restore phase. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2248 Cc: ...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c index 1122bd4eae98..4d780e4430e7 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c @@ -907,13 +907,13 @@ static void sdma_v4_0_ring_emit_fence(struct amdgpu_ring *ring, u64...
37ea9693869627df5b15cbd4d67237e17f806be4
Analyze and fix the following issue in the Linux kernel code: ACPI: APEI: EINJ: Fix formatting errors
Problem Details: Checkpatch reveals warnings and an error due to missing lines and incorrect indentations. Add the missing lines after declarations and fix the suspect indentations. Signed-off-by: Jay Lu <jaylu102@amd.com> Signed-off-by: Ben Cheatham <benjamin.cheatham@amd.com> Reviewed-by: Tony Luck <tony.luck@intel....
```diff diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 6b583373c58a..1a2641937eb6 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -358,6 +358,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, */ if ((param_extension || acpi5) && (type & MEM_ERROR_MASK...
955f4d7176eb154db587ae162ec2b392dc8d5f27
Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix documentation for intel_uncore_forcewake_put__locked
Problem Details: intel_uncore_forcewake_put__locked() is used to release a reference. Fixes: a6111f7b6604 ("drm/i915: Reduce locking in execlist command submission") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid...
```diff diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index 92e6f03f18af..9995f478152c 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -821,9 +821,9 @@ void intel_uncore_forcewake_flush(struct intel_uncore *uncore, } /** - * inte...
7d21e0b1b41b21d628bf2afce777727bd4479aa5
Analyze and fix the following issue in the Linux kernel code: media: si470x: Fix use-after-free in si470x_int_in_callback()
Problem Details: syzbot reported use-after-free in si470x_int_in_callback() [1]. This indicates that urb->context, which contains struct si470x_device object, is freed when si470x_int_in_callback() is called. The cause of this issue is that si470x_int_in_callback() is called for freed urb. si470x_usb_driver_probe() ...
```diff diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index 6b2768623c88..aa7a580dbecc 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c @@ -727,8 +727,10 @@ static int si470x_usb_driver_probe(struc...
faaf901727eddcfbe889fe172ec9cdb5e63c8236
Analyze and fix the following issue in the Linux kernel code: media: staging: stkwebcam: Restore MEDIA_{USB,CAMERA}_SUPPORT dependencies
Problem Details: By moving support for the USB Syntek DC1125 Camera to staging, the dependencies on MEDIA_USB_SUPPORT and MEDIA_CAMERA_SUPPORT were lost. Fixes: 56280c64ecac ("media: stkwebcam: deprecate driver, move to staging") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Ricardo Ribalda ...
```diff diff --git a/drivers/staging/media/deprecated/stkwebcam/Kconfig b/drivers/staging/media/deprecated/stkwebcam/Kconfig index 4450403dff41..7234498e634a 100644 --- a/drivers/staging/media/deprecated/stkwebcam/Kconfig +++ b/drivers/staging/media/deprecated/stkwebcam/Kconfig @@ -2,7 +2,7 @@ config VIDEO_STKWEBCAM ...
6e5e5defdb8b0186312c2f855ace175aee6daf9b
Analyze and fix the following issue in the Linux kernel code: media: coda: Add check for kmalloc
Problem Details: As the kmalloc may return NULL pointer, it should be better to check the return value in order to avoid NULL poineter dereference, same as the others. Fixes: cb1d3a336371 ("[media] coda: add CODA7541 JPEG support") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Hans Verkuil <hverk...
```diff diff --git a/drivers/media/platform/chips-media/coda-bit.c b/drivers/media/platform/chips-media/coda-bit.c index 6d816fd69a17..ed47d5bd8d61 100644 --- a/drivers/media/platform/chips-media/coda-bit.c +++ b/drivers/media/platform/chips-media/coda-bit.c @@ -1084,10 +1084,16 @@ static int coda_start_encoding(struct...
6b8082238fb8bb20f67e46388123e67a5bbc558d
Analyze and fix the following issue in the Linux kernel code: media: coda: Add check for dcoda_iram_alloc
Problem Details: As the coda_iram_alloc may return NULL pointer, it should be better to check the return value in order to avoid NULL poineter dereference, same as the others. Fixes: b313bcc9a467 ("[media] coda: simplify IRAM setup") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Hans Verkuil <hve...
```diff diff --git a/drivers/media/platform/chips-media/coda-bit.c b/drivers/media/platform/chips-media/coda-bit.c index 2736a902e3df..6d816fd69a17 100644 --- a/drivers/media/platform/chips-media/coda-bit.c +++ b/drivers/media/platform/chips-media/coda-bit.c @@ -854,7 +854,7 @@ static void coda_setup_iram(struct coda_c...
a8a0bc8106a10681069b887e6f15304ce77b7ea3
Analyze and fix the following issue in the Linux kernel code: dt-bindings: media: s5c73m3: Fix reset-gpio descriptor
Problem Details: The reset-gpios is described as xshutdown-gpios on the required properties, as it is on the driver. Despite that, the device tree example set the property 'reset-gpios' instead of the property 'xshutdown-gpios'. Therefore, this patch updates the example to match the property specified on the driver. ...
```diff diff --git a/Documentation/devicetree/bindings/media/samsung-s5c73m3.txt b/Documentation/devicetree/bindings/media/samsung-s5c73m3.txt index 21f31fdf5543..f0ea9adad442 100644 --- a/Documentation/devicetree/bindings/media/samsung-s5c73m3.txt +++ b/Documentation/devicetree/bindings/media/samsung-s5c73m3.txt @@ -7...
e895d62188d2cc916e342c603fba87e892b881b0
Analyze and fix the following issue in the Linux kernel code: media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property
Problem Details: The Hantro G2 video decoder block sits behind an IOMMU. The device tree binding needs a property to reference it. Without a reference for the implementation to properly configure the IOMMU, it will fault and cause the video decoder to fail. Add an "iommus" property for referring to the IOMMU port. The...
```diff diff --git a/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml b/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml index 24d7bf21499e..9d44236f2deb 100644 --- a/Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml +++ b/Documentation/devicetree/bind...
d8a46bc4e1e0446459daa77c4ce14218d32dacf9
Analyze and fix the following issue in the Linux kernel code: media: s5p-mfc: Fix to handle reference queue during finishing
Problem Details: On receiving last buffer driver puts MFC to MFCINST_FINISHING state which in turn skips transferring of frame from SRC to REF queue. This causes driver to stop MFC encoding and last frame is lost. This patch guarantees safe handling of frames during MFCINST_FINISHING and correct clearing of workbit to...
```diff diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c index b65e506665af..f62703cebb77 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_enc.c @@ -1218,6 +1218,7 @@ static int ...
d3f3c2fe54e30b0636496d842ffbb5ad3a547f9b
Analyze and fix the following issue in the Linux kernel code: media: s5p-mfc: Clear workbit to handle error condition
Problem Details: During error on CLOSE_INSTANCE command, ctx_work_bits was not getting cleared. During consequent mfc execution NULL pointer dereferencing of this context led to kernel panic. This patch fixes this issue by making sure to clear ctx_work_bits always. Fixes: 818cd91ab8c6 ("[media] s5p-mfc: Extract open/c...
```diff diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c index 72d70984e99a..6d3c92045c05 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c @@ -468,8 +468,10 @@ void s5p...
06710cd5d2436135046898d7e4b9408c8bb99446
Analyze and fix the following issue in the Linux kernel code: media: s5p-mfc: Fix in register read and write for H264
Problem Details: Few of the H264 encoder registers written were not getting reflected since the read values were not stored and getting overwritten. Fixes: 6a9c6f681257 ("[media] s5p-mfc: Add variants to access mfc registers") Cc: stable@vger.kernel.org Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy <smitha.t...
```diff diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c index 8227004f6746..c0df5ac9fcff 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c @@ -1060,7 +1060,7 @@...
e65faec54192984e157eb8e49ea29d4eccacf185
Analyze and fix the following issue in the Linux kernel code: media: ths7303: Fix the include guard
Problem Details: Everything is about THS7303, so let the include guard reflect it as well to avoid potential future conflict. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
```diff diff --git a/include/media/i2c/ths7303.h b/include/media/i2c/ths7303.h index 95492d12786d..fee2818c558d 100644 --- a/include/media/i2c/ths7303.h +++ b/include/media/i2c/ths7303.h @@ -10,8 +10,8 @@ * Martin Bugge <marbugge@cisco.com> */ -#ifndef THS7353_H -#define THS7353_H +#ifndef THS7303_H +#define ...
63ff05a1ad242a5a0f897921c87b70d601bda59c
Analyze and fix the following issue in the Linux kernel code: media: c8sectpfe: Add of_node_put() when breaking out of loop
Problem Details: In configure_channels(), we should call of_node_put() when breaking out of for_each_child_of_node() which will automatically increase and decrease the refcount. Fixes: c5f5d0f99794 ("[media] c8sectpfe: STiH407/10 Linux DVB demux support") Signed-off-by: Liang He <windhl@126.com> Signed-off-by: Hans Ve...
```diff diff --git a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c index 4c5027a0480d..c38b62d4f1ae 100644 --- a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c @@ -927,6 +927,7 ...
f18caf261398a7f2de4fa3f600deb87072fe7b8d
Analyze and fix the following issue in the Linux kernel code: device property: Fix documentation for fwnode_get_next_parent()
Problem Details: Use fwnode_handle_put() on the node pointer to release the refcount. Change fwnode_handle_node() to fwnode_handle_put(). Fixes: 233872585de1 ("device property: Add fwnode_get_next_parent()") Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Daniel Scally <djrscally@gmail.co...
```diff diff --git a/drivers/base/property.c b/drivers/base/property.c index ed74083c179d..bbb3e499ff4a 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -609,7 +609,7 @@ EXPORT_SYMBOL_GPL(fwnode_get_parent); * node's parents. * * Returns a node pointer with refcount incremented, use - * fwnod...
f66f73421f0a929734bb41dde575e6d7859e548f
Analyze and fix the following issue in the Linux kernel code: io_uring: skip spinlocking for ->task_complete
Problem Details: ->task_complete was added to serialised CQE posting by doing it from the task context only (or fallback wq when the task is dead), and now we can use that to avoid taking ->completion_lock while filling CQ entries. The patch skips spinlocking only in two spots, __io_submit_flush_completions() and flush...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 310cdd864a6c..d367dbe1284f 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -584,13 +584,25 @@ void __io_commit_cqring_flush(struct io_ring_ctx *ctx) io_eventfd_flush_signal(ctx); } +static inline void __io_cq_lock(struct io_ring_ct...
a6365c2da9faf7c7bcb81fbc4b422e9f319c9f0c
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: fw: use correct IML/ROM status register
Problem Details: Different registers should be used, but they code wasn't adjusted for the 'error' register, only for the 'data1'. Fix that. Coverity CID: 1487176 Coverity CID: 1487230 Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lor...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dump.c b/drivers/net/wireless/intel/iwlwifi/fw/dump.c index 03b1b2428b5e..792f7fee1840 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dump.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dump.c @@ -377,7 +377,7 @@ static void iwl_fwrt_dump_iml_error_log(struc...
b201944af11f7b2c860bef5cb562eb7163427724
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: Don't use deprecated register
Problem Details: The CSR_HW_IF_CONFIG_REG register is no longer in use from IWL_DEVICE_FAMILY_AX210 and on. This register uses now for CSR_CTXT_INFO_BOOT_CTRL which has a different meaning and a different format. Currently we're writing to the register according to CSR_HW_IF_CONFIG_REGs format, regardless to the device...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index e78f5beaa2d0..ebe6d9c4ccaf 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -92,6 +92,12 @@ static void iwl_mvm_nic_config(struct iwl_op_m...
1174e8fcbba89593f67240c3395554b3812a4981
Analyze and fix the following issue in the Linux kernel code: wifi: iwlwifi: mvm: don't access packet before checking len
Problem Details: Currently in sniffer mode we access pkt fields before checking that the frame has the length to access it. Fix this by moving the check to before the access. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lo...
```diff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c index 5f782ca1e254..97b67270f384 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c @@ -2066,22 +2066,30 @@ void iwl_mvm_rx_monitor_no_data(struc...
87a39882b5ab3127700ac4b9277608075f98eda2
Analyze and fix the following issue in the Linux kernel code: net: dsa: mv88e6xxx: accept phy-mode = "internal" for internal PHY ports
Problem Details: The ethernet-controller dt-schema, mostly pushed forward by Linux, has the "internal" PHY mode for denoting MAC connections to an internal PHY. U-Boot may provide device tree blobs where this phy-mode is specified, so make the Linux driver accept them. It appears that the current behavior with phy-mo...
```diff diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 2479be3a1e35..937cb22cb3d4 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -833,10 +833,13 @@ static void mv88e6xxx_get_caps(struct dsa_switch *ds, int port, chip->info->ops->phylin...
7dfa764e0223a324366a2a1fc056d4d9d4e95491
Analyze and fix the following issue in the Linux kernel code: xen/netback: fix build warning
Problem Details: Commit ad7f402ae4f4 ("xen/netback: Ensure protocol headers don't fall in the non-linear area") introduced a (valid) build warning. There have even been reports of this problem breaking networking of Xen guests. Fixes: ad7f402ae4f4 ("xen/netback: Ensure protocol headers don't fall in the non-linear are...
```diff diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 054ac0e897f6..bf627af723bf 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -530,7 +530,7 @@ static int xenvif_tx_check_gop(struct xenvif_queue *queue, const bool sharedslot = nr_f...
9e624651859214fb2c4e442b059eba0aefcd0801
Analyze and fix the following issue in the Linux kernel code: xen/netback: don't call kfree_skb() under spin_lock_irqsave()
Problem Details: It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled. So replace kfree_skb() with dev_kfree_skb_irq() under spin_lock_irqsave(). Fixes: be81992f9086 ("xen/netback: don't queue unlimited number of packages") Signed-off-by: Yang Yingliang <yangyingliang...
```diff diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c index 932762177110..d022206a0d17 100644 --- a/drivers/net/xen-netback/rx.c +++ b/drivers/net/xen-netback/rx.c @@ -92,7 +92,7 @@ void xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb) struct net_device *dev = queue->v...
86020156c8840f2a47430f028e6ab557d8a9ed27
Analyze and fix the following issue in the Linux kernel code: HID: bpf: do not rely on ALLOW_ERROR_INJECTION
Problem Details: Now that we have aproper non debug API to declare which function is fmodret, we can rely on it. Link: https://lore.kernel.org/all/20221121104403.1545f9b5@gandalf.local.home/ Suggested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.co...
```diff diff --git a/drivers/hid/bpf/hid_bpf_dispatch.c b/drivers/hid/bpf/hid_bpf_dispatch.c index c3920c7964dc..58e608ebf0fa 100644 --- a/drivers/hid/bpf/hid_bpf_dispatch.c +++ b/drivers/hid/bpf/hid_bpf_dispatch.c @@ -44,7 +44,6 @@ __weak noinline int hid_bpf_device_event(struct hid_bpf_ctx *ctx) { return 0; } -AL...
cf34ac6aa2b12fb0c3aacfdcae8acd7904b949ec
Analyze and fix the following issue in the Linux kernel code: regulator: qcom-labibb: Fix missing of_node_put() in qcom_labibb_regulator_probe()
Problem Details: The reg_node needs to be released through of_node_put() in the error handling path when of_irq_get_byname() failed. Fixes: 390af53e0411 ("regulator: qcom-labibb: Implement short-circuit and over-current IRQs") Signed-off-by: Yuan Can <yuancan@huawei.com> Link: https://lore.kernel.org/r/20221203062109....
```diff diff --git a/drivers/regulator/qcom-labibb-regulator.c b/drivers/regulator/qcom-labibb-regulator.c index 639b71eb41ff..bcf7140f3bc9 100644 --- a/drivers/regulator/qcom-labibb-regulator.c +++ b/drivers/regulator/qcom-labibb-regulator.c @@ -822,6 +822,7 @@ static int qcom_labibb_regulator_probe(struct platform_de...
38eef3be38ab895959c442702864212cc3beb96c
Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8183: fix refcount leak in mt8183_mt6358_ts3a227_max98357_dev_probe()
Problem Details: The node returned by of_parse_phandle() with refcount incremented, of_node_put() needs be called when finish using it. So add it in the error path in mt8183_mt6358_ts3a227_max98357_dev_probe(). Fixes: 11c0269017b2 ("ASoC: Mediatek: MT8183: Add machine driver with TS3A227") Signed-off-by: Wang Yufen <w...
```diff diff --git a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c index 8fb473543cf9..ce9aedde7e1e 100644 --- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c @@ -677,8...
ef0a098efb36660326c133af9b5a04a96a00e3ca
Analyze and fix the following issue in the Linux kernel code: ASoC: rockchip: pdm: Add missing clk_disable_unprepare() in rockchip_pdm_runtime_resume()
Problem Details: The clk_disable_unprepare() should be called in the error handling of rockchip_pdm_runtime_resume(). Fixes: fc05a5b22253 ("ASoC: rockchip: add support for pdm controller") Signed-off-by: Wang Jingjin <wangjingjin1@huawei.com> Link: https://lore.kernel.org/r/20221205032802.2422983-1-wangjingjin1@huawei...
```diff diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index a7549f827235..5b1e47bdc376 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -431,6 +431,7 @@ static int rockchip_pdm_runtime_resume(struct device *dev) ret = clk_prepare_enable(p...
8ab2d12c726f0fde0692fa5d81d8019b3dcd62d0
Analyze and fix the following issue in the Linux kernel code: ASoC: audio-graph-card: fix refcount leak of cpu_ep in __graph_for_each_link()
Problem Details: The of_get_next_child() returns a node with refcount incremented, and decrements the refcount of prev. So in the error path of the while loop, of_node_put() needs be called for cpu_ep. Fixes: fce9b90c1ab7 ("ASoC: audio-graph-card: cleanup DAI link loop method - step2") Signed-off-by: Wang Yufen <wangy...
```diff diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index fe7cf972d44c..5daa824a4ffc 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -485,8 +485,10 @@ static int __graph_for_each_link(struct asoc_simple_priv *priv, of_node_...
3327d721114c109ba0575f86f8fda3b525404054
Analyze and fix the following issue in the Linux kernel code: ASoC: mediatek: mt8173-rt5650-rt5514: fix refcount leak in mt8173_rt5650_rt5514_dev_probe()
Problem Details: The node returned by of_parse_phandle() with refcount incremented, of_node_put() needs be called when finish using it. So add it in the error path in mt8173_rt5650_rt5514_dev_probe(). Fixes: 0d1d7a664288 ("ASoC: mediatek: Refine mt8173 driver and change config option") Signed-off-by: Wang Yufen <wangy...
```diff diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c index 12f40c81b101..f803f121659d 100644 --- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c +++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c @@ -200,14 +200,16 @@ static int mt8173_rt5650_rt...
171107237246d66bce04f3769d33648f896b4ce3
Analyze and fix the following issue in the Linux kernel code: ASoC: Intel: Skylake: Fix driver hang during shutdown
Problem Details: AudioDSP cores and HDAudio links need to be turned off on shutdown to ensure no communication or data transfer occurs during the procedure. Fixes: c5a76a246989 ("ASoC: Intel: Skylake: Add shutdown callback") Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Tested-by: Lukasz Majczak <lma@semi...
```diff diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index 9bd9f9866898..998bd0232cf1 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -1107,7 +1107,10 @@ static void skl_shutdown(struct pci_dev *pci) if (!skl->init_done) return; - snd_hdac_stop_stre...
73a0b6ee5d6269f92df43e1d09b3278a2886bf8a
Analyze and fix the following issue in the Linux kernel code: ARM: 9278/1: kfence: only handle translation faults
Problem Details: This is a similar fixup like arm64 does, only handle translation faults in case of unexpected kfence report when alignment faults on ARM, see more from commit 0bb1fbffc631 ("arm64: mm: kfence: only handle translation faults"). Fixes: 75969686ec0d ("ARM: 9166/1: Support KFENCE for ARM") Signed-off-by: ...
```diff diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index 46cccd6bf705..de988cba9a4b 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c @@ -105,6 +105,19 @@ static inline bool is_write_fault(unsigned int fsr) return (fsr & FSR_WRITE) && !(fsr & FSR_CM); } +static inline bool is_translation_fault...
4bf5bf54476dffe60e6b6d8d539f67309ff599e2
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/realtek: Add quirk for Lenovo TianYi510Pro-14IOB
Problem Details: Lenovo TianYi510Pro-14IOB (17aa:3742) require quirk for enabling headset-mic Signed-off-by: Edward Pacman <edward@edward-p.xyz> Cc: <stable@vger.kernel.org> Link: https://bugzilla.kernel.org/show_bug.cgi?id=216756 Link: https://lore.kernel.org/r/20221207133218.18989-1-edward@edward-p.xyz Signed-off-by...
```diff diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 5f51f8fc7fdc..e443d88f627f 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -10999,6 +10999,17 @@ static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec, } } +static void alc897_fi...
dcef77274ae52136925287b6b59d5c6e6a4adfb9
Analyze and fix the following issue in the Linux kernel code: nvme: pass nr_maps explicitly to nvme_alloc_io_tag_set
Problem Details: Don't look at ctrl->ops as only RDMA and TCP actually support multiple maps. Fixes: 6dfba1c09c10 ("nvme-fc: use the tagset alloc/free helpers") Fixes: ceee1953f923 ("nvme-loop: use the tagset alloc/free helpers") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.m...
```diff diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 30717f7cfc94..3b369900928f 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4891,7 +4891,7 @@ EXPORT_SYMBOL_GPL(nvme_remove_admin_tag_set); int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *s...
1b346e4aa8e79227391ffd6b7c6ee5acf0fa8bfc
Analyze and fix the following issue in the Linux kernel code: io_uring: don't check overflow flush failures
Problem Details: The only way to fail overflowed CQEs flush is for CQ to be fully packed. There is one place checking for flush failures, i.e. io_cqring_wait(), but we limit the number to be waited for by the CQ size, so getting a failure automatically means that we're done with waiting. Don't check for failures, rare...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index ecd78898dbd3..ba5ef1e675c1 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -618,13 +618,12 @@ static void io_cqring_overflow_kill(struct io_ring_ctx *ctx) } /* Returns true if there are no backlogged entries after the flush */ -stati...
a85381d8326d75417ae177bddf44be533d1d21be
Analyze and fix the following issue in the Linux kernel code: io_uring: skip overflow CQE posting for dying ring
Problem Details: After io_ring_ctx_wait_and_kill() is called there should be no users poking into rings and so there is no need to post CQEs. So, instead of trying to post overflowed CQEs into the CQ, drop them. Also, do it in io_ring_exit_work() in a loop to reduce the number of contexts it can be executed from and ev...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 5fa92170c373..ecd78898dbd3 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -600,12 +600,30 @@ void io_cq_unlock_post(struct io_ring_ctx *ctx) } /* Returns true if there are no backlogged entries after the flush */ -static bool __io_c...
998b30c3948e4d0b1097e639918c5cff332acac5
Analyze and fix the following issue in the Linux kernel code: io_uring: Fix a null-ptr-deref in io_tctx_exit_cb()
Problem Details: Syzkaller reports a NULL deref bug as follows: BUG: KASAN: null-ptr-deref in io_tctx_exit_cb+0x53/0xd3 Read of size 4 at addr 0000000000000138 by task file1/1955 CPU: 1 PID: 1955 Comm: file1 Not tainted 6.1.0-rc7-00103-gef4d3ea40565 #75 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ...
```diff diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 8840cf3e20f2..61cd7ffd0f6a 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2707,8 +2707,10 @@ static __cold void io_tctx_exit_cb(struct callback_head *cb) /* * When @in_idle, we're in cancellation and it's racy to remove the * n...
1ca8a011ddca3e44340d9db611b019054dfc37d6
Analyze and fix the following issue in the Linux kernel code: dt-bindings: Fix maintainer email for a few ROHM ICs
Problem Details: The email backend used by ROHM keeps labeling patches as spam. This can result to missing the patches. Switch my mail address from a company mail to a personal one. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> Acked-by: Mark B...
```diff diff --git a/Documentation/devicetree/bindings/leds/rohm,bd71828-leds.yaml b/Documentation/devicetree/bindings/leds/rohm,bd71828-leds.yaml index 86a37c92b834..d48c404c848e 100644 --- a/Documentation/devicetree/bindings/leds/rohm,bd71828-leds.yaml +++ b/Documentation/devicetree/bindings/leds/rohm,bd71828-leds.ya...
85842c46fd47fa6bd78681c154223bed27d5fd19
Analyze and fix the following issue in the Linux kernel code: mfd: bd957x: Fix Kconfig dependency on REGMAP_IRQ
Problem Details: The BD957x driver uses REGMAP_IRQ but does not 'select' to depend on it. This can cause build failures. Select REGMAP_IRQ for BD957X. Fixes: 0e9692607f94 ("mfd: bd9576: Add IRQ support") Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Signed-off-by: Lee Jones <lee@kernel.org> Link:...
```diff diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 6653d03e0fe3..d6f1b0d3d829 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -2017,6 +2017,7 @@ config MFD_ROHM_BD957XMUF depends on I2C=y depends on OF select REGMAP_I2C + select REGMAP_IRQ select MFD_CORE help Select this o...
c79e387389d5add7cb967d2f7622c3bf5550927b
Analyze and fix the following issue in the Linux kernel code: mfd: stpmic1: Fix swapped mask/unmask in irq chip
Problem Details: The usual behavior of mask registers is writing a '1' bit to disable (mask) an interrupt; similarly, writing a '1' bit to an unmask register enables (unmasks) an interrupt. Due to a longstanding issue in regmap-irq, mask and unmask registers were inverted when both kinds of registers were present on t...
```diff diff --git a/drivers/mfd/stpmic1.c b/drivers/mfd/stpmic1.c index 54a4d59d1937..8db1530d9bac 100644 --- a/drivers/mfd/stpmic1.c +++ b/drivers/mfd/stpmic1.c @@ -108,8 +108,9 @@ static const struct regmap_irq stpmic1_irqs[] = { static const struct regmap_irq_chip stpmic1_regmap_irq_chip = { .name = "pmic_irq", ...
3f37d4f695cff180033254b9ed5adc8ab927cba9
Analyze and fix the following issue in the Linux kernel code: mfd: axp20x: Do not sleep in the power off handler
Problem Details: Since commit 856c288b0039 ("ARM: Use do_kernel_power_off()"), the function axp20x_power_off() now runs inside a RCU read-side critical section, so it is not allowed to call msleep(). Use mdelay() instead. Fixes: 856c288b0039 ("ARM: Use do_kernel_power_off()") Signed-off-by: Samuel Holland <samuel@shol...
```diff diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index 88a212a8168c..880c41fa7021 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -842,7 +842,7 @@ static void axp20x_power_off(void) AXP20X_OFF); /* Give capacitors etc. time to drain to avoid kernel panic msg. */ - msleep(500)...
0a5219f34fea85a0e583de2aa4528548acaa85f4
Analyze and fix the following issue in the Linux kernel code: mfd: mc13xxx-spi: Fix typo ("transfert")
Problem Details: That spelling is only correct in French :-) Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221101165045.1017822-1-j.neuschaefer@gmx.net
```diff diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c index 2809fbeb317c..f70d79aa5a83 100644 --- a/drivers/mfd/mc13xxx-spi.c +++ b/drivers/mfd/mc13xxx-spi.c @@ -114,7 +114,7 @@ static int mc13xxx_spi_write(void *context, const void *data, size_t count) * result, the SS will negate before all of ...
3633daacea2e54bf991d2f6b871efe9f83a0cac8
Analyze and fix the following issue in the Linux kernel code: mfd: rk808: Permit having multiple PMIC instances
Problem Details: This set each cells id to PLATFORM_DEVID_NONE to allow multiple instances of each cell in case multiple PMICs handled by the rk808 driver are probed. This fixes probing a RK818 and a RK817 on the Odroid Go Ultra devices. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Lee Jon...
```diff diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c index b390bba542e6..f44fc3f080a8 100644 --- a/drivers/mfd/rk808.c +++ b/drivers/mfd/rk808.c @@ -137,58 +137,64 @@ static const struct resource rk817_charger_resources[] = { }; static const struct mfd_cell rk805s[] = { - { .name = "rk808-clkout", }, - { ...
727b67e34969ab7ad254a379664bbb492ae0bc5a
Analyze and fix the following issue in the Linux kernel code: mfd: qcom-pm8xxx: Drop unused PM8018 compatible
Problem Details: The PM8018 compatible is always used with PM8921 fallback, so PM8018 compatible can be safely removed from device ID table Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https:/...
```diff diff --git a/drivers/mfd/qcom-pm8xxx.c b/drivers/mfd/qcom-pm8xxx.c index 2f2734ba5273..601106580e2e 100644 --- a/drivers/mfd/qcom-pm8xxx.c +++ b/drivers/mfd/qcom-pm8xxx.c @@ -497,7 +497,6 @@ static const struct pm_irq_data pm8821_data = { }; static const struct of_device_id pm8xxx_id_table[] = { - { .compat...
6af338b0011727da68c32ba79f8dfab8524fc4ae
Analyze and fix the following issue in the Linux kernel code: dt-bindings: mfd: qcom-pm8xxx: Document qcom,pm8921 as fallback of qcom,pm8018
Problem Details: The PM8018 is used as compatible with PM8921 on the MDM9615, document this situation, and an example section to validate this change. Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel...
```diff diff --git a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml index 61bd0b3ce02f..84b87f01e029 100644 --- a/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom-pm8xxx.yaml @@ -15,11 +15,15 @@ descr...
5f4f94e9f26cca6514474b307b59348b8485e711
Analyze and fix the following issue in the Linux kernel code: mfd: mt6360: Add bounds checking in Regmap read/write call-backs
Problem Details: Fix the potential risk of OOB read if bank index is over the maximum. Refer to the discussion list for the experiment result on mt6370. https://lore.kernel.org/all/20220914013345.GA5802@cyhuang-hp-elitebook-840-g3.rt/ If not to check the bound, there is the same issue on mt6360. Cc: stable@vger.kerne...
```diff diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index 6eaa6775b888..d3b32eb79837 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -402,7 +402,7 @@ static int mt6360_regmap_read(void *context, const void *reg, size_t reg_size, struct mt6360_ddata *ddata = context; ...
763ab98687404d924b6612f7c9c8430333d31229
Analyze and fix the following issue in the Linux kernel code: dt-bindings: mfd: qcom,spmi-pmic: Drop PWM reg dependency
Problem Details: The PWM node is not a separate device and is expected to be part of parent SPMI PMIC node, thus it obtains the address space from the parent. One IO address in "reg" is also not correct description because LPG block maps to several regions. Fixes: 3f5117be9584 ("dt-bindings: mfd: convert to yaml Qualc...
```diff diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml index 6a3e3ede1ede..777f2da52f1e 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml @@ -98,6 +98,...
a234442c0b51163841762748e7e22c3718337923
Analyze and fix the following issue in the Linux kernel code: mmc: sdhci-brcmstb: Resolve "unused" warnings with CONFIG_OF=n
Problem Details: With W=1, we can see this gcc warning: drivers/mmc/host/sdhci-brcmstb.c:182:34: warning: ‘sdhci_brcm_of_match’ defined but not used [-Wunused-const-variable=] 182 | static const struct of_device_id sdhci_brcm_of_match[] = { | ^~~~~~~~~~~~~~~~~~~ Rather than pl...
```diff diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c index 55d8bd232695..f2cf3d70db79 100644 --- a/drivers/mmc/host/sdhci-brcmstb.c +++ b/drivers/mmc/host/sdhci-brcmstb.c @@ -179,7 +179,7 @@ static const struct brcmstb_match_priv match_priv_7216 = { .ops = &sdhci_brcmstb_ops_7216, ...
4a44cd249604e29e7b90ae796d7692f5773dd348
Analyze and fix the following issue in the Linux kernel code: mmc: vub300: fix warning - do not call blocking ops when !TASK_RUNNING
Problem Details: vub300_enable_sdio_irq() works with mutex and need TASK_RUNNING here. Ensure that we mark current as TASK_RUNNING for sleepable context. [ 77.554641] do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffff92a72c1d>] sdio_irq_thread+0x17d/0x5b0 [ 77.554652] WARNING: CPU: 2 PID: 1983 ...
```diff diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c index ab36ec479747..72f65f32abbc 100644 --- a/drivers/mmc/host/vub300.c +++ b/drivers/mmc/host/vub300.c @@ -2049,6 +2049,7 @@ static void vub300_enable_sdio_irq(struct mmc_host *mmc, int enable) return; kref_get(&vub300->kref); if (enable...
fc02e2b52389c8fde02852b2f959c0b45f042bbd
Analyze and fix the following issue in the Linux kernel code: mmc: core: Normalize the error handling branch in sd_read_ext_regs()
Problem Details: Let's use pr_err() to output the error messages and let's extend a comment to clarify why returning 0 (success) in one case make sense. Fixes: c784f92769ae ("mmc: core: Read the SD function extension registers for power management") Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> [Ulf: Clarified ...
```diff diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 3662bf5320ce..72b664ed90cf 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1259,7 +1259,7 @@ static int sd_read_ext_regs(struct mmc_card *card) */ err = sd_read_ext_reg(card, 0, 0, 0, 512, gen_info_buf); if (err) { - pr_...
4f431a047a5c8698ed4b67e2760cfbeb5fffb69d
Analyze and fix the following issue in the Linux kernel code: memstick/ms_block: Add check for alloc_ordered_workqueue
Problem Details: As the alloc_ordered_workqueue may return NULL pointer, it should be better to add check for the return value. Moreover, the msb->io_queue should be freed if error occurs later. Fixes: 0ab30494bc4f ("memstick: add support for legacy memorysticks") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> L...
```diff diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c index ba8414519515..04115cd92433 100644 --- a/drivers/memstick/core/ms_block.c +++ b/drivers/memstick/core/ms_block.c @@ -2116,6 +2116,11 @@ static int msb_init_disk(struct memstick_dev *card) dbg("Set total disk size to %lu sect...
1e8cb505f3d4a3e9c31238a45509a17e688525a0
Analyze and fix the following issue in the Linux kernel code: mmc: Remove unneeded semicolon
Problem Details: ./drivers/mmc/host/sunplus-mmc.c:321:2-3: Unneeded semicolon Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3238 Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20221123021221.9646-1-yang.lee@linux.alibaba.com...
```diff diff --git a/drivers/mmc/host/sunplus-mmc.c b/drivers/mmc/host/sunplus-mmc.c index 5c36daf09bfb..db5e0dcdfa7f 100644 --- a/drivers/mmc/host/sunplus-mmc.c +++ b/drivers/mmc/host/sunplus-mmc.c @@ -318,7 +318,7 @@ static void spmmc_set_bus_width(struct spmmc_host *host, int width) value &= ~SPMMC_SD_DATA_WD; ...
e81bdae440fa7cc7dcbfb4f0fcfafb1f4350bc31
Analyze and fix the following issue in the Linux kernel code: mmc: core: Remove non-data R1B ioctl workaround
Problem Details: The workaround of pretending R1B non-data transfers are data transfers in order for the busy timeout to be respected by the host controller driver is removed. It wasn't useful in a long time. Initially the workaround ensured that R1B commands did not time out by setting the data timeout to be the comm...
```diff diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index db6d8a099910..20da7ed43e6d 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -514,19 +514,6 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, if (idata->ic.data_timeout_ns) data.ti...
ffbace4378dc1aedb02248bbbe5d231754e4df3a
Analyze and fix the following issue in the Linux kernel code: mmc: renesas_sdhi: use plain numbers for end_flags
Problem Details: Linux *_bit accessors take plain bit numbers, no need for BIT(). Fixes: c330601c9c93 ("mmc: renesas_sdhi: take DMA end interrupts into account") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> ...
```diff diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h index ea2a85174a09..68da3da9e2e5 100644 --- a/drivers/mmc/host/renesas_sdhi.h +++ b/drivers/mmc/host/renesas_sdhi.h @@ -57,8 +57,8 @@ struct renesas_sdhi_of_data_with_quirks { }; /* We want both end_flags to be set before we mark...
3d4f9898c1c74323dd61d6a8a0efca9401232ad4
Analyze and fix the following issue in the Linux kernel code: mmc: renesas_sdhi: alway populate SCC pointer
Problem Details: We need the SCC pointer to reset the device, so populate it even when we don't need it for tuning. Fixes: 45bffc371fef ("mmc: renesas_sdhi: only reset SCC when its pointer is populated") Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesa...
```diff diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index b93ab11f112a..4372197dc2a9 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -1067,11 +1067,14 @@ int renesas_sdhi_probe(struct platform_device *pdev, if (ver >= SDHI_VE...
63abdf7237a7ab9e3ee30782d64d968a087c7e7a
Analyze and fix the following issue in the Linux kernel code: mmc: sdhci: Fix the SD tuning issue that the SDHCI_TRANSFER_MODE is cleared incorrectly
Problem Details: When cmd->opcode == MMC_SEND_TUNING_BLOCK, the SDHCI_TRANSFER_MODE should also be kept Signed-off-by: Charl Liu <charl.liu@bayhubtech.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20221111122314.307-1-charl.liu@bayhubtech.com Signed-off-by: Ulf Hansson <ulf.han...
```diff diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index ebb71d235c38..64750fbb0ac8 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1452,7 +1452,7 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, if (host->quirks2 & SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG...
7f3ea248cd1b2ea9b49f6f3523250bc8e622dd5e
Analyze and fix the following issue in the Linux kernel code: mmc: renesas_sdhi: improve naming of DMA struct
Problem Details: Commit 058db2868cd8 ("mmc: tmio, renesas_sdhi: move struct tmio_mmc_dma to renesas_sdhi.h") is correct. The DMA struct should be prefixed with 'renesas_sdhi' to avoid confusion about is namespace. Fix some indentation while here. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by...
```diff diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h index c4abfee1ebae..b661892847f6 100644 --- a/drivers/mmc/host/renesas_sdhi.h +++ b/drivers/mmc/host/renesas_sdhi.h @@ -53,12 +53,12 @@ struct renesas_sdhi_of_data_with_quirks { const struct renesas_sdhi_quirks *quirks; }; -stru...
4b323f02b6e8df1b04292635ef829e7f723bf50e
Analyze and fix the following issue in the Linux kernel code: mmc: mtk-sd: fix two spelling mistakes in comment
Problem Details: spelling mistake fix : "alreay" -> "already" "checksume" -> "checksum" Signed-off-by: Yu Zhe <yuzhe@nfschina.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20221110072819.11530-1-yuzhe@nfschina.com Signed-off-by: Ulf Hans...
```diff diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 422817f7d559..abadfc319053 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -750,7 +750,7 @@ static inline void msdc_dma_setup(struct msdc_host *host, struct msdc_dma *dma, else bd[j].bd_info &= ~BDMA_DESC_E...
b38a20f29a49ae04d23750d104b25400b792b98c
Analyze and fix the following issue in the Linux kernel code: mmc: mmci: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, it will lead two issues: 1. The memory that allocated in mmc_alloc_host() is leaked. 2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-...
```diff diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 012aa85489d8..b9e5dfe74e5c 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -2256,7 +2256,9 @@ static int mmci_probe(struct amba_device *dev, pm_runtime_set_autosuspend_delay(&dev->dev, 50); pm_runtime_use_autosuspend(...
dc5b9b50fc9d1334407e316e6e29a5097ef833bd
Analyze and fix the following issue in the Linux kernel code: mmc: wbsd: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, it will lead two issues: 1. The memory that allocated in mmc_alloc_host() is leaked. 2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-...
```diff diff --git a/drivers/mmc/host/wbsd.c b/drivers/mmc/host/wbsd.c index 2219144c166a..521af9251f33 100644 --- a/drivers/mmc/host/wbsd.c +++ b/drivers/mmc/host/wbsd.c @@ -1698,7 +1698,17 @@ static int wbsd_init(struct device *dev, int base, int irq, int dma, */ wbsd_init_device(host); - mmc_add_host(mmc); + ...
e4e46fb61e3bb4628170810d3f2b996b709b90d9
Analyze and fix the following issue in the Linux kernel code: mmc: via-sdmmc: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, it will lead two issues: 1. The memory that allocated in mmc_alloc_host() is leaked. 2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-...
```diff diff --git a/drivers/mmc/host/via-sdmmc.c b/drivers/mmc/host/via-sdmmc.c index 88662a90ed96..a2b0d9461665 100644 --- a/drivers/mmc/host/via-sdmmc.c +++ b/drivers/mmc/host/via-sdmmc.c @@ -1151,7 +1151,9 @@ static int via_sd_probe(struct pci_dev *pcidev, pcidev->subsystem_device == 0x3891) sdhost->quirks...
90935f16f2650ab7416fa2ffbe5c28cb39cf3f1e
Analyze and fix the following issue in the Linux kernel code: mmc: meson-gx: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, it will lead two issues: 1. The memory that allocated in mmc_alloc_host() is leaked. 2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-...
```diff diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index df05e60bed9a..6e5ea0213b47 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -1335,7 +1335,9 @@ static int meson_mmc_probe(struct platform_device *pdev) } mmc->ops = &meson_mmc_ops; - m...
a525cad241c339ca00bf7ebf03c5180f2a9b767c
Analyze and fix the following issue in the Linux kernel code: mmc: omap_hsmmc: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, it will lead two issues: 1. The memory that allocated in mmc_alloc_host() is leaked. 2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-...
```diff diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index fca30add563e..4bd744755205 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1946,7 +1946,9 @@ static int omap_hsmmc_probe(struct platform_device *pdev) if (!ret) mmc->caps |= MMC_CAP_SDIO_IRQ;...
9e6e8c43726673ca2abcaac87640b9215fd72f4c
Analyze and fix the following issue in the Linux kernel code: mmc: atmel-mci: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, it will lead two issues: 1. The memory that allocated in mmc_alloc_host() is leaked. 2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-...
```diff diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 91d52ba7a39f..bb9bbf1c927b 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -2222,6 +2222,7 @@ static int atmci_init_slot(struct atmel_mci *host, { struct mmc_host *mmc; struct atmel_mci_slot *s...
5c1a2b77cd1b59112cf22b3e338f7e416797ad32
Analyze and fix the following issue in the Linux kernel code: mmc: litex_mmc: ensure `host->irq == 0` if polling
Problem Details: Ensure the flag is explicitly set to 0 if we determine that polling is needed during driver probe, to cover all possible cases. Fixes: 92e099104729 ("mmc: Add driver for LiteX's LiteSDCard interface") Signed-off-by: Gabriel Somlo <gsomlo@gmail.com> Link: https://lore.kernel.org/r/20221107155516.253591...
```diff diff --git a/drivers/mmc/host/litex_mmc.c b/drivers/mmc/host/litex_mmc.c index 6ba0d63b8c07..39c6707fdfdb 100644 --- a/drivers/mmc/host/litex_mmc.c +++ b/drivers/mmc/host/litex_mmc.c @@ -502,6 +502,7 @@ static int litex_mmc_irq_init(struct platform_device *pdev, use_polling: host->mmc->caps |= MMC_CAP_NEED...
29276d56f6ed138db0f38cd31aedc0b725c8c76c
Analyze and fix the following issue in the Linux kernel code: mmc: wmt-sdmmc: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path. So fix this by checking the return value and goto error path which will call mmc_free_ho...
```diff diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c index 9b5c503e3a3f..9aa3027ca25e 100644 --- a/drivers/mmc/host/wmt-sdmmc.c +++ b/drivers/mmc/host/wmt-sdmmc.c @@ -856,11 +856,15 @@ static int wmt_mci_probe(struct platform_device *pdev) /* configure the controller to a known 'ready' sta...
0613ad2401f88bdeae5594c30afe318e93b14676
Analyze and fix the following issue in the Linux kernel code: mmc: vub300: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path. So fix this by checking the return value and goto error path which will call mmc_free_ho...
```diff diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c index 97beece62fec..ab36ec479747 100644 --- a/drivers/mmc/host/vub300.c +++ b/drivers/mmc/host/vub300.c @@ -2299,14 +2299,14 @@ static int vub300_probe(struct usb_interface *interface, 0x0000, 0x0000, &vub300->system_port_status, sizeo...
f670744a316ea983113a65313dcd387b5a992444
Analyze and fix the following issue in the Linux kernel code: mmc: toshsd: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path. So fix this by checking the return value and goto error path which will call mmc_free_ho...
```diff diff --git a/drivers/mmc/host/toshsd.c b/drivers/mmc/host/toshsd.c index 8d037c2071ab..497791ffada6 100644 --- a/drivers/mmc/host/toshsd.c +++ b/drivers/mmc/host/toshsd.c @@ -651,7 +651,9 @@ static int toshsd_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (ret) goto unmap; - mmc_add_host...
fc38a5a10e9e5a75eb9189854abeb8405b214cc9
Analyze and fix the following issue in the Linux kernel code: mmc: rtsx_usb_sdmmc: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path. So fix this by checking the return value and calling mmc_free_host() in the error path, ...
```diff diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index 5798aee06653..2c650cd58693 100644 --- a/drivers/mmc/host/rtsx_usb_sdmmc.c +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c @@ -1329,6 +1329,7 @@ static int rtsx_usb_sdmmc_drv_probe(struct platform_device *pdev) #ifdef RTSX_USB_USE_...
0c87db77423a282b3b38b8a6daf057b822680516
Analyze and fix the following issue in the Linux kernel code: mmc: rtsx_pci: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path. So fix this by checking the return value and calling mmc_free_host() in the error path, ...
```diff diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c index e1580f78c6b2..8098726dcc0b 100644 --- a/drivers/mmc/host/rtsx_pci_sdmmc.c +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c @@ -1474,6 +1474,7 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev) struct realtek_pci_...
80e1ef3afb8bfbe768380b70ffe1b6cab87d1a3b
Analyze and fix the following issue in the Linux kernel code: mmc: pxamci: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path. So fix this by checking the return value and goto error path which will call mmc_free_ho...
```diff diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index e4003f6058eb..2a988f942b6c 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c @@ -763,7 +763,12 @@ static int pxamci_probe(struct platform_device *pdev) dev_warn(dev, "gpio_ro and get_ro() both defined\n"); } - ...
cde600af7b413c9fe03e85c58c4279df90e91d13
Analyze and fix the following issue in the Linux kernel code: mmc: mxcmmc: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path. So fix this by checking the return value and goto error path which will call mmc_free_ho...
```diff diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index 2cf0413407ea..668f865f3efb 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -1143,7 +1143,9 @@ static int mxcmci_probe(struct platform_device *pdev) timer_setup(&host->watchdog, mxcmci_watchdog, 0); - mmc_add...
0ca18d09c744fb030ae9bc5836c3e357e0237dea
Analyze and fix the following issue in the Linux kernel code: mmc: moxart: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path. So fix this by checking the return value and goto error path which will call mmc_free_ho...
```diff diff --git a/drivers/mmc/host/moxart-mmc.c b/drivers/mmc/host/moxart-mmc.c index dfc3ffd5b1f8..52ed30f2d9f4 100644 --- a/drivers/mmc/host/moxart-mmc.c +++ b/drivers/mmc/host/moxart-mmc.c @@ -665,7 +665,9 @@ static int moxart_probe(struct platform_device *pdev) goto out; dev_set_drvdata(dev, mmc); - mmc_a...
e93d1468f429475a753d6baa79b853b7ee5ef8c0
Analyze and fix the following issue in the Linux kernel code: mmc: alcor: fix return value check of mmc_add_host()
Problem Details: mmc_add_host() may return error, if we ignore its return value, the memory that allocated in mmc_alloc_host() will be leaked and it will lead a kernel crash because of deleting not added device in the remove path. So fix this by checking the return value and calling mmc_free_host() in the error path. ...
```diff diff --git a/drivers/mmc/host/alcor.c b/drivers/mmc/host/alcor.c index bfb8efeb7eb8..d01df01d4b4d 100644 --- a/drivers/mmc/host/alcor.c +++ b/drivers/mmc/host/alcor.c @@ -1114,7 +1114,10 @@ static int alcor_pci_sdmmc_drv_probe(struct platform_device *pdev) alcor_hw_init(host); dev_set_drvdata(&pdev->dev, ...
08b863bb034cfda73ac2d37faab9d54185f04231
Analyze and fix the following issue in the Linux kernel code: mmc: sdhci-*: Convert drivers to new sdhci_and_cqhci_reset()
Problem Details: An earlier patch ("mmc: cqhci: Provide helper for resetting both SDHCI and CQHCI") does these operations for us. I keep these as a separate patch, since the earlier patch is a prerequisite to some important bugfixes that need to be backported via linux-stable. Signed-off-by: Brian Norris <briannorris...
```diff diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 3a091a387ecb..03f76384ab3f 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -19,6 +19,7 @@ #include <linux/pinctrl/consumer.h> #include <linux/reset.h> +#include "sdhci-cqhci.h" #include "sdhci-plt...
0b36b7cd3f1f3df707c98de65b764294c02cc8cc
Analyze and fix the following issue in the Linux kernel code: dt-bindings: mmc: mtk-sd: Set clocks based on compatible
Problem Details: The binding was describing a single clock list for all platforms, but that's not really suitable: Most platforms using at least 2 clocks (source, hclk), some of them a third "source_cg". Mt2712 requires an extra 'bus_clk' on some of its controllers, while mt8192 requires 8 clocks. Move the clock defi...
```diff diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml index d8e1e2e9adf2..0cedeb12892d 100644 --- a/Documentation/devicetree/bindings/mmc/mtk-sd.yaml +++ b/Documentation/devicetree/bindings/mmc/mtk-sd.yaml @@ -10,9 +10,6 @@ maintainers: - Chaotian ...
1ad0dcb984c51db655f38ed97bb88545fd55f407
Analyze and fix the following issue in the Linux kernel code: mmc: host: Fix repeated words in comments
Problem Details: Delete the redundant word 'the'. Signed-off-by: wangjianli <wangjianli@cdjrlc.com> Link: https://lore.kernel.org/r/20221022062237.10333-1-wangjianli@cdjrlc.com Link: https://lore.kernel.org/r/20221022062331.11395-1-wangjianli@cdjrlc.com Link: https://lore.kernel.org/r/20221022062505.13155-1-wangjianli...
```diff diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index c78bbc22e0d1..d35607128322 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1363,7 +1363,7 @@ static void __dw_mci_start_request(struct dw_mci *host, * is just about to roll over. * * We do this whole ...
9aafbfa5f57a4b75bafd3bed0191e8429c5fa618
Analyze and fix the following issue in the Linux kernel code: powerpc/pseries/eeh: use correct API for error log size
Problem Details: rtas-error-log-max is not the name of an RTAS function, so rtas_token() is not the appropriate API for retrieving its value. We already have rtas_get_error_log_max() which returns a sensible value if the property is absent for any reason, so use that instead. Fixes: 8d633291b4fc ("powerpc/eeh: pseries...
```diff diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c index ea890037843c..6b507b62ce8f 100644 --- a/arch/powerpc/platforms/pseries/eeh_pseries.c +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c @@ -848,16 +848,7 @@ static int __init eeh_pseries_init(void) }...
6c606e57eecc37d6b36d732b1ff7e55b7dc32dd4
Analyze and fix the following issue in the Linux kernel code: powerpc/rtas: avoid scheduling in rtas_os_term()
Problem Details: It's unsafe to use rtas_busy_delay() to handle a busy status from the ibm,os-term RTAS function in rtas_os_term(): Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b BUG: sleeping function called from invalid context at arch/powerpc/kernel/rtas.c:618 in_atomic(): 1, irqs_disabled(...
```diff diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index db43cbdcc74c..f21b39fcaf99 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@ -964,10 +964,15 @@ void rtas_os_term(char *str) snprintf(rtas_os_term_buf, 2048, "OS panic: %s", str); + /* + * Keep calling as...
4fad22a1281c500f15b172c9d261eff347ca634b
Analyze and fix the following issue in the Linux kernel code: dpaa2-switch: Fix memory leak in dpaa2_switch_acl_entry_add() and dpaa2_switch_acl_entry_remove()
Problem Details: The cmd_buff needs to be freed when error happened in dpaa2_switch_acl_entry_add() and dpaa2_switch_acl_entry_remove(). Fixes: 1110318d83e8 ("dpaa2-switch: add tc flower hardware offload on ingress traffic") Signed-off-by: Yuan Can <yuancan@huawei.com> Link: https://lore.kernel.org/r/20221205061515.11...
```diff diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c index cacd454ac696..c39b866e2582 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c @@ -132,6...
e22dcbc9aa329e7902a8c9f8d11aba74f5d7c97d
Analyze and fix the following issue in the Linux kernel code: net: ethernet: mtk_wed: Fix missing of_node_put() in mtk_wed_wo_hardware_init()
Problem Details: The np needs to be released through of_node_put() in the error handling path of mtk_wed_wo_hardware_init(). Fixes: 799684448e3e ("net: ethernet: mtk_wed: introduce wed wo support") Signed-off-by: Yuan Can <yuancan@huawei.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Link: https://lore.kernel.o...
```diff diff --git a/drivers/net/ethernet/mediatek/mtk_wed_wo.c b/drivers/net/ethernet/mediatek/mtk_wed_wo.c index a219da85f4db..a0a39643caf7 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed_wo.c +++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.c @@ -408,8 +408,10 @@ mtk_wed_wo_hardware_init(struct mtk_wed_wo *wo) r...
063a932b64db3317ec020c94466fe52923a15f60
Analyze and fix the following issue in the Linux kernel code: ethernet: aeroflex: fix potential skb leak in greth_init_rings()
Problem Details: The greth_init_rings() function won't free the newly allocated skb when dma_mapping_error() returns error, so add dev_kfree_skb() to fix it. Compile tested only. Fixes: d4c41139df6e ("net: Add Aeroflex Gaisler 10/100/1G Ethernet MAC driver") Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com...
```diff diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c index e104fb02817d..aa0d2f3aaeaa 100644 --- a/drivers/net/ethernet/aeroflex/greth.c +++ b/drivers/net/ethernet/aeroflex/greth.c @@ -258,6 +258,7 @@ static int greth_init_rings(struct greth_private *greth) if (dma_mapp...
88956177db179e4eba7cd590971961857d1565b8
Analyze and fix the following issue in the Linux kernel code: tipc: call tipc_lxc_xmit without holding node_read_lock
Problem Details: When sending packets between nodes in netns, it calls tipc_lxc_xmit() for peer node to receive the packets where tipc_sk_mcast_rcv()/tipc_sk_rcv() might be called, and it's pretty much like in tipc_rcv(). Currently the local 'node rw lock' is held during calling tipc_lxc_xmit() to protect the peer_net...
```diff diff --git a/net/tipc/node.c b/net/tipc/node.c index b48d97cbbe29..49ddc484c4fe 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -1689,6 +1689,7 @@ int tipc_node_xmit(struct net *net, struct sk_buff_head *list, struct tipc_node *n; struct sk_buff_head xmitq; bool node_up = false; + struct net *peer_n...
918ee4911f7a41fb4505dff877c1d7f9f64eb43e
Analyze and fix the following issue in the Linux kernel code: can: esd_usb: Allow REC and TEC to return to zero
Problem Details: We don't get any further EVENT from an esd CAN USB device for changes on REC or TEC while those counters converge to 0 (with ecc == 0). So when handling the "Back to Error Active"-event force txerr = rxerr = 0, otherwise the berr-counters might stay on values like 95 forever. Also, to make life easier...
```diff diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c index 81b88e9e5bdc..42323f5e6f3a 100644 --- a/drivers/net/can/usb/esd_usb.c +++ b/drivers/net/can/usb/esd_usb.c @@ -234,6 +234,10 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv, u8 rxerr = msg->msg.rx.data[2]; u8 txe...
f4a4d121ebecaa6f396f21745ce97de014281ccc
Analyze and fix the following issue in the Linux kernel code: can: can327: flush TX_work on ldisc .close()
Problem Details: Additionally, remove it from .ndo_stop(). This ensures that the worker is not called after being freed, and that the UART TX queue remains active to send final commands when the netdev is stopped. Thanks to Jiri Slaby for finding this in slcan: https://lore.kernel.org/linux-can/20221201073426.1732...
```diff diff --git a/drivers/net/can/can327.c b/drivers/net/can/can327.c index ed3d0b8989a0..dc7192ecb001 100644 --- a/drivers/net/can/can327.c +++ b/drivers/net/can/can327.c @@ -796,9 +796,9 @@ static int can327_netdev_close(struct net_device *dev) netif_stop_queue(dev); - /* Give UART one final chance to flush....
fb855e9f3b6b42c72af3f1eb0b288998fe0d5ebb
Analyze and fix the following issue in the Linux kernel code: can: slcan: fix freed work crash
Problem Details: The LTP test pty03 is causing a crash in slcan: BUG: kernel NULL pointer dereference, address: 0000000000000008 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 0 PID: 348 Comm: kworker/0:3 Not tainted 6...
```diff diff --git a/drivers/net/can/slcan/slcan-core.c b/drivers/net/can/slcan/slcan-core.c index fbb34139daa1..f4db77007c13 100644 --- a/drivers/net/can/slcan/slcan-core.c +++ b/drivers/net/can/slcan/slcan-core.c @@ -864,12 +864,14 @@ static void slcan_close(struct tty_struct *tty) { struct slcan *sl = (struct slc...
0acc442309a0a1b01bcdaa135e56e6398a49439c
Analyze and fix the following issue in the Linux kernel code: can: af_can: fix NULL pointer dereference in can_rcv_filter
Problem Details: Analogue to commit 8aa59e355949 ("can: af_can: fix NULL pointer dereference in can_rx_register()") we need to check for a missing initialization of ml_priv in the receive path of CAN frames. Since commit 4e096a18867a ("net: introduce CAN specific pointer in the struct net_device") the check for dev->t...
```diff diff --git a/net/can/af_can.c b/net/can/af_can.c index 27dcdcc0b808..c69168f11e44 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c @@ -677,7 +677,7 @@ static void can_receive(struct sk_buff *skb, struct net_device *dev) static int can_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_typ...
bdbbae241a04f387ba910b8609f95fad5f1470c7
Analyze and fix the following issue in the Linux kernel code: gpiolib: protect the GPIO device against being dropped while in use by user-space
Problem Details: While any of the GPIO cdev syscalls is in progress, the kernel can call gpiochip_remove() (for instance, when a USB GPIO expander is disconnected) which will set gdev->chip to NULL after which any subsequent access will cause a crash. To avoid that: use an RW-semaphore in which the syscalls take it fo...
```diff diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c index ac10c9494bf0..f7289c2f3a3c 100644 --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -55,6 +55,50 @@ static_assert(IS_ALIGNED(sizeof(struct gpio_v2_line_values), 8)); * interface to gpiolib GPIOs via ioctl()s. *...
533aae7c94dbc2b14301cfd68ae7e0e90f0c8438
Analyze and fix the following issue in the Linux kernel code: gpiolib: cdev: fix NULL-pointer dereferences
Problem Details: There are several places where we can crash the kernel by requesting lines, unbinding the GPIO device, then calling any of the system calls relevant to the GPIO character device's annonymous file descriptors: ioctl(), read(), poll(). While I observed it with the GPIO simulator, it will also happen for...
```diff diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c index 08606f32372c..ac10c9494bf0 100644 --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -201,6 +201,9 @@ static long linehandle_ioctl(struct file *file, unsigned int cmd, unsigned int i; int ret; + if (!lh->gdev-...
78a9ea43fc1a7c06a420b132d2d47cbf4344a5df
Analyze and fix the following issue in the Linux kernel code: net: dsa: sja1105: fix memory leak in sja1105_setup_devlink_regions()
Problem Details: When dsa_devlink_region_create failed in sja1105_setup_devlink_regions(), priv->regions is not released. Fixes: bf425b82059e ("net: dsa: sja1105: expose static config as devlink region") Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-...
```diff diff --git a/drivers/net/dsa/sja1105/sja1105_devlink.c b/drivers/net/dsa/sja1105/sja1105_devlink.c index 10c6fea1227f..bdbbff2a7909 100644 --- a/drivers/net/dsa/sja1105/sja1105_devlink.c +++ b/drivers/net/dsa/sja1105/sja1105_devlink.c @@ -95,6 +95,8 @@ static int sja1105_setup_devlink_regions(struct dsa_switch ...
c0d999348e01df03e0a7f550351f3907fabbf611
Analyze and fix the following issue in the Linux kernel code: ipv4: Fix incorrect route flushing when table ID 0 is used
Problem Details: Cited commit added the table ID to the FIB info structure, but did not properly initialize it when table ID 0 is used. This can lead to a route in the default VRF with a preferred source address not being flushed when the address is deleted. Consider the following example: # ip address add dev dummy...
```diff diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index f361d3d56be2..b5736ef16ed2 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -841,6 +841,9 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb, return -EINVAL; } + if (!cfg->fc_table) + cfg->fc_tabl...
f96a3d74554df537b6db5c99c27c80e7afadc8d1
Analyze and fix the following issue in the Linux kernel code: ipv4: Fix incorrect route flushing when source address is deleted
Problem Details: Cited commit added the table ID to the FIB info structure, but did not prevent structures with different table IDs from being consolidated. This can lead to routes being flushed from a VRF when an address is deleted from a different VRF. Fix by taking the table ID into account when looking for a match...
```diff diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 19a662003eef..ce9ff3c62e84 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -423,6 +423,7 @@ static struct fib_info *fib_find_info(struct fib_info *nfi) nfi->fib_prefsrc == fi->fib_prefsrc && nfi->fib_pri...
7ff5d60f18bba5cbaf17b2926aa9da44d5beca01
Analyze and fix the following issue in the Linux kernel code: remoteproc: qcom: q6v5: Fix missing clk_disable_unprepare() in q6v5_wcss_qcs404_power_on()
Problem Details: q6v5_wcss_qcs404_power_on() have no fail path for readl_poll_timeout(). Add fail path for readl_poll_timeout(). Fixes: 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404") Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com> Signed-off-by: Bjorn Andersson <andersson@kern...
```diff diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c index de232337e082..ba24d745b2d6 100644 --- a/drivers/remoteproc/qcom_q6v5_wcss.c +++ b/drivers/remoteproc/qcom_q6v5_wcss.c @@ -351,7 +351,7 @@ static int q6v5_wcss_qcs404_power_on(struct q6v5_wcss *wcss) if (ret) { dev_...
38e7d9c19276832ebb0277f415b9214bf7baeb37
Analyze and fix the following issue in the Linux kernel code: remoteproc: qcom_q6v5_pas: Fix missing of_node_put() in adsp_alloc_memory_region()
Problem Details: The pointer node is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: b9e718e950c3 ("remoteproc: Introduce Qualcomm ADSP PIL") Signed-off-by: Yuan Can <yuancan@huawei.com> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lo...
```diff diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index a14ff1142e76..dc6f07ca8341 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -449,6 +449,7 @@ static int adsp_alloc_memory_region(struct qcom_adsp *adsp) } ret = of_address_...
7e6303567ce3ca506e4a2704e4baa86f1d8bde02
Analyze and fix the following issue in the Linux kernel code: net: fec: properly guard irq coalesce setup
Problem Details: Prior to the Fixes: commit, the initialization code went through the same fec_enet_set_coalesce() function as used by ethtool, and that function correctly checks whether the current variant has support for irq coalescing. Now that the initialization code instead calls fec_enet_itr_coal_set() directly,...
```diff diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 2ca2b61b451f..23e1a94b9ce4 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1220,7 +1220,8 @@ fec_restart(struct net_device *ndev) writel(0, fep->...
1f154f3b56a1a172833eedf77b72745acc8d9259
Analyze and fix the following issue in the Linux kernel code: bonding: get correct NA dest address
Problem Details: In commit 4d633d1b468b ("bonding: fix ICMPv6 header handling when receiving IPv6 messages"), there is a copy/paste issue for NA daddr. I found that in my testing and fixed it in my local branch. But I forgot to re-format the patch and sent the wrong mail. Fix it by reading the correct dest address. F...
```diff diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index f298b9b3eb77..b9a882f182d2 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3247,7 +3247,7 @@ static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond, goto out; saddr ...