summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-07-15Documentation: locking.rst: update deprecated functionManuel Ebner
replace strcpy() with strscpy() as suggested in deprecated.rst Signed-off-by: Manuel Ebner <manuelebner@mailbox.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260531175452.272136-2-manuelebner@mailbox.org>
2026-07-15docs: pt_BR: update netdevsim section in maintainer-netdev.rstAmanda CorrĂȘa
Update the Brazilian Portuguese translation of maintainer-netdev.rst to align with the latest English version. Key changes include: - Updated the netdevsim section to reflect upstream changes - Added guidance on netdevsim-based API testing - Fixed minor spacing and formatting issues Signed-off-by: Amanda CorrĂȘa <amandacorreasilvax@gmail.com> Acked-by: Daniel Pereira <danielmaraboo@gmail.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260616005234.11036-1-amandacorreasilvax@gmail.com>
2026-07-15docs: pt_BR: Translate patch posting documentationDaniel Pereira
Translate the chapter regarding the process of formatting and sending patches ("5.Posting.rst") into Brazilian Portuguese. Also, update the main index in "development-process.rst" to include the newly translated document into the documentation tree. Signed-off-by: Daniel Pereira <danielmaraboo@gmail.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260614235044.42810-3-danielmaraboo@gmail.com>
2026-07-15docs: pt_BR: Translate 4.coding.rst into PortugueseDaniel Pereira
Translate the chapter regarding coding standards and patch formatting rules ("4.Coding.rst") into Brazilian Portuguese. This translation helps Portuguese-speaking developers better understand the core guidelines required for kernel code contributions. Signed-off-by: Daniel Pereira <danielmaraboo@gmail.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260614235044.42810-2-danielmaraboo@gmail.com>
2026-07-15Documentation: dev-tools: scripts/container prefers PodmanCoiby Xu
Obviously scripts/container prefers Podman over Docker. Putting podman before docker also makes it consistent with following parts of the doc and the help text of the tool. Signed-off-by: Coiby Xu <coiby.xu@gmail.com> Reviewed-by: Guillaume Tucker <gtucker@gtucker.io> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260624013850.1853171-1-coiby.xu@gmail.com>
2026-07-15docs: kdoc: fix troff output description typoYousef Alhouseen
Fix a typo in the ManFormat documentation string that describes the generated troff title header fields. Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260624122448.4853-1-alhouseenyousef@gmail.com>
2026-07-15Docs: SMP: add an SMP docbook chapterRandy Dunlap
Add SMP primitives to the core-api documentation. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Thomas Gleixner <tglx@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260625210331.1050915-1-rdunlap@infradead.org>
2026-07-15Docs: conf.py: fix typos in commentsRandy Dunlap
Change "variabled" to "variables". Change "relative patch" to "relative path". Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260626005248.1121464-1-rdunlap@infradead.org>
2026-07-15docs: pagemap: fix flags location, member name and sample codeZenghui Yu
The userland visible page flags (KPF_*) were initially moved to include/linux/kernel-page-flags.h in commit 1a9b5b7fe0c5 ("mm: export stable page flags"), and later moved to include/uapi/linux/kernel-page-flags.h in commit 607ca46e97a1 ("UAPI: (Scripted) Disintegrate include/linux"). Update the doc to reflect the current location of these flags. The member @walk_end of struct pm_scan_arg {} was wrongly written as "end_walk". The first sample code of the PAGEMAP_SCAN ioctl wrongly used the PM_SCAN_CHECK_WPASYNC flag twice, instead of the PM_SCAN_WP_MATCHING flag. The second one included the wrong category in the required mask - PAGE_IS_FILE should be used instead of PAGE_IS_SWAPPED as per the intention. Fix them all together. Signed-off-by: Zenghui Yu <zenghui.yu@linux.dev> Reviewed-by: Lorenzo Stoakes <ljs@kernel.org> Reviewed-by: SeongJae Park <sj@kernel.org> Acked-by: David Hildenbrand (Arm) <david@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260626162710.25844-1-zenghui.yu@linux.dev>
2026-07-15Documentation: admin-guide: fix brackets and translation issueManuel Ebner
Add missing ']' and replace 'neuer Name' with 'new Name'. Signed-off-by: Manuel Ebner <manuelebner@mailbox.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260629110812.69420-2-manuelebner@mailbox.org>
2026-07-15docs: kernel-hacking: fix typoManuel Ebner
'GP_KERNEL' -> 'GFP_KERNEL' Remove trailing '`' without clear purpose Signed-off-by: Manuel Ebner <manuelebner@mailbox.org> Reviewed-by: SJ Park <sj@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260629152912.86500-2-manuelebner@mailbox.org>
2026-07-15PNP: ACPI: Stop using acpi_device_name()Rafael J. Wysocki
Since acpi_device_name() checked by pnpacpi_add_device() is never populated, its length is always zero and the codition checking it is always false. Accordingly, drop that condition and use acpi_device_bid(device) for setting dev->name in pnpacpi_add_device() unconditionally. No intentional functional impact. This will facilitate the removal of device_name from struct acpi_device_pnp in the future. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/23191780.EfDdHjke4D@rafael.j.wysocki
2026-07-15ACPI: PAD: xen: Stop setting acpi_device_name/class()Rafael J. Wysocki
The driver sets acpi_device_name() and acpi_device_class() which are never read afterward, so make it stop doing that and drop the symbols defined specifically for this purpose. No intentional functional impact. This will facilitate the removal of device_name and device_class from struct acpi_device_pnp in the future. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Juergen Gross <jgross@suse.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/2384190.iZASKD2KPV@rafael.j.wysocki
2026-07-15platform/loongarch: laptop: Stop setting acpi_device_class()Rafael J. Wysocki
The driver populates acpi_device_class() which is never read afterward, so make it stop doing that and drop the symbol defined specifically for this purpose. No intentional functional impact. This will facilitate the removal of device_class from struct acpi_device_pnp in the future. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/2444678.ElGaqSPkdT@rafael.j.wysocki
2026-07-15fortify: Disable -Wstringop-overread in testsNathan Chancellor
clang recently added support for -Wstringop-overread [1], which is on by default like -Wfortify-source. This breaks the usage of -Werror in the fortify tests, resulting in the following false positive warnings in the kernel build: warning: unsafe memcmp() usage lacked '__read_overflow2' warning in lib/test_fortify/read_overflow2-memcmp.c warning: unsafe memcmp() usage lacked '__read_overflow' warning in lib/test_fortify/read_overflow-memcmp.c warning: unsafe memchr() usage lacked '__read_overflow' warning in lib/test_fortify/read_overflow-memchr.c Examining the fortify test logs shows a warning like the following in each of the failed logs: In file included from lib/test_fortify/read_overflow2-memcmp.c:5: lib/test_fortify/test_fortify.h:34:2: error: 'memcmp' reading 17 bytes from a region of size 16 [-Werror,-Wstringop-overread] 34 | TEST; | ^ lib/test_fortify/read_overflow2-memcmp.c:3:2: note: expanded from macro 'TEST' 3 | memcmp(large, small, sizeof(small) + 1) | ^ 1 error generated. Disable -Wstringop-overread for the fortify tests, as it defeats the purpose of testing the Linux specific implementation of fortify, like -Wfortify-source. Cc: stable@vger.kernel.org Closes: https://github.com/ClangBuiltLinux/linux/issues/2168 Link: https://github.com/llvm/llvm-project/commit/86f2e71cb8d165b59ad31a442b2391e23826133e [1] Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://patch.msgid.link/20260623-fix-test_fortify-for-clang-stringop-overread-v1-1-15ee8342a953@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
2026-07-15ASoC: bt-sco: fix duplicate DAPM widget names for wideband DAIShengjiu Wang
The bt-sco-pcm-wb DAI uses the same stream_name strings as bt-sco-pcm ("Playback" and "Capture"). This causes duplicate DAPM AIF widget names within the same component, leading to debugfs warnings: debugfs: 'Playback' already exists in 'dapm' debugfs: 'Capture' already exists in 'dapm' Give the wideband DAI distinct stream names ("WB Playback" and "WB Capture") and add corresponding DAPM AIF widgets and routes for them. Fixes: 5947e1b4992e ("ASoC: bt-sco: extend rate and add a general compatible string") Assisted-by: VeroCoder:claude-sonnet-4-5 Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/20260715100620.1387159-1-shengjiu.wang@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-07-15MAINTAINERS: add myself as reviewer of software node supportBartosz Golaszewski
I've been working extensively on software nodes lately and introduced some changes. Add myself as reviewer so that I can help review any new proposed changes. Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Link: https://patch.msgid.link/20260713-swnode-fw-devlink-v4-4-d4f2dee27ad9@oss.qualcomm.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-07-15software node: add kunit tests for fw_devlink supportBartosz Golaszewski
Add a kunit test suite for fw_devlink support for software nodes. Most cases call add_links() directly and inspect the resulting fwnode supplier/consumer lists: a single reference, multiple references, a reference to an unregistered node, a "remote-endpoint" reference and a reference array. The last case is end-to-end - it registers real consumer and supplier platform devices together with their drivers, adds the consumer first and checks that fw_devlink defers its probe until the supplier has been bound. Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: David Gow <david@davidgow.net> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Link: https://patch.msgid.link/20260713-swnode-fw-devlink-v4-3-d4f2dee27ad9@oss.qualcomm.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-07-15software node: add fw_devlink supportBartosz Golaszewski
Software nodes can be used to describe supplier-consumer relationships between devices they represent using reference property entries. Unlike for OF-nodes, driver core cannot yet use these references to create a probe order that avoids needless probe deferrals on missing providers. Implement software_node_add_links() modelled on of_fwnode_add_links(). For every DEV_PROP_REF property we resolve each referenced supplier and create an fwnode link from the node to it. The driver core later promotes these to device links and defers the consumer until the suppliers are ready. There's no allowlist like the one DT needs - devicetree phandles appear in plenty of non-supplier contexts, but a software node only carries a reference property when its author explicitly points at another node, so we treat every reference as an intentional supplier dependency and link all of them. Graph "remote-endpoint" references are skipped for now: they go 2-ways between endpoint nodes and would create graph cycles without the port-parent lifting DT does via get_con_dev(). References to suppliers that aren't registered yet and self-references are ignored. fw_devlink resolves the supplier device through fwnode->dev but the core only records the owning device on the primary fwnode. When the software node is a device's secondary fwnode, mirror the device pointer onto it in software_node_notify() so the consumer can actually find the supplier instead of deferring forever. While at it: purge the fwnode links in software_node_release() now that software nodes can own them. Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Link: https://patch.msgid.link/20260713-swnode-fw-devlink-v4-2-d4f2dee27ad9@oss.qualcomm.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-07-15kunit: provide a set of fwnode-oriented helpersBartosz Golaszewski
Provide three new kunit-managed helpers for test cases that need to register/create dynamic software nodes. Reviewed-by: David Gow <david@davidgow.net> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Link: https://patch.msgid.link/20260713-swnode-fw-devlink-v4-1-d4f2dee27ad9@oss.qualcomm.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-07-15cpufreq: schedutil: Fix self-contradictory comment in sugov_iowait_apply()Zhongqiu Han
The kerneldoc of sugov_iowait_apply() says the IO boost value is increased in sugov_iowait_apply() and, in the same sentence, that it is decreased by the same function. That is self-contradictory, and the first part is wrong: sugov_iowait_apply() only decreases the boost. The boost is actually increased in sugov_iowait_boost(). Fix the comment to name sugov_iowait_boost() as the place where the boost is increased, so it matches the code. No functional change. Fixes: fd7d5287fd65 ("cpufreq: schedutil: Cleanup and document iowait boost") Signed-off-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com> Reviewed-by: Christian Loehle <christian.loehle@arm.com> Link: https://patch.msgid.link/20260703092433.4080165-1-zhongqiu.han@oss.qualcomm.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-15Documentation: admin-guide: cpufreq: fix sampling_rate example commandwangxiaodong
The example shell command for setting ondemand's sampling_rate wraps an arithmetic expansion $((...)) in command-substitution backticks. The arithmetic result is then executed as a command, which fails and writes an empty value. Drop the surrounding backticks so the computed value is passed to echo as intended. Fixes: e54ac586674d ("cpufreq: editing corrections to cpufreq.rst") Signed-off-by: wangxiaodong <wangxiaodong827546786@gmail.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com> [ rjw: Subject tweak ] Link: https://patch.msgid.link/20260621022515.10137-1-wangxiaodong827546786@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-15cpufreq: intel_pstate: Move two functions closer to callersRafael J. Wysocki
Move intel_pstate_set_pstate() and intel_pstate_set_min_pstate() closer to their first callers. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [ rjw: Changelog adjustment ] Link: https://patch.msgid.link/3433588.44csPzL39Z@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-15cpufreq: intel_pstate: Consolidate frequency values computationRafael J. Wysocki
Update intel_pstate_get_cpu_pstates() to use intel_pstate_update_freq_limits() for computing the max and turbo frequency values in all cases, including non-hybrid HWP and HWP disabled. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3059329.e9J7NaK4W3@rafael.j.wysocki
2026-07-15cpufreq: intel_pstate: Introduce intel_pstate_update_freq_limits()Rafael J. Wysocki
Introduce a new helper function, intel_pstate_update_freq_limits(), for updating the max and turbo frequency values for the given CPU after updating the corresponding P-states. Use it in intel_pstate_get_hwp_cap() and intel_pstate_get_cpu_pstates(), in the latter case instead of the direct updates of the max and turbo frequency values in intel_pstate_hybrid_hwp_adjust(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2277328.irdbgypaU6@rafael.j.wysocki
2026-07-15cpufreq: intel_pstate: Fix setting minimum P-state at init timeRafael J. Wysocki
If HWP is enabled, writes to MSR_IA32_PERF_CTL have no effect, so intel_pstate_get_cpu_pstates() should not attempt to call intel_pstate_set_min_pstate() to set the minimum P-state for the given CPU in that case. Accordingly, remove the intel_pstate_set_min_pstate() call from intel_pstate_get_cpu_pstates() and make both intel_pstate_cpu_init() and intel_cpufreq_cpu_init() call that function in their non-HWP code paths. The HWP code path in intel_pstate_cpu_init() does not need to update the current P-state of the CPU directly at all because it is taken care of the processor automatically, but the HWP code path of intel_cpufreq_cpu_init() should update it in principle to initialize the DESIRED_PERF field in MSR_HWP_REQUEST. For this purpose, make it call intel_cpufreq_hwp_update() and pass the minimum P-state limit to it as the current target value along with the current minimum and maximum limits. Fixes: f6ebbcf08f37 ("cpufreq: intel_pstate: Implement passive mode with HWP enabled") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/5090465.GXAFRqVoOG@rafael.j.wysocki
2026-07-15cpufreq: intel_pstate: Rename INTEL_PSTATE_HWP_BROADWELLRafael J. Wysocki
Since the only role of INTEL_PSTATE_HWP_BROADWELL is to indicate that hybrid HWP should not be used, rename it to INTEL_PSTATE_HWP_NOT_HYBRID. No functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3431755.44csPzL39Z@rafael.j.wysocki
2026-07-15cpufreq: intel_pstate: Simplify HWP handling on BroadwellRafael J. Wysocki
After commit de5bcf404ace ("cpufreq: intel_pstate: Clean up frequency computations"), the Broadwell HWP mode does not actually do anything useful because intel_pstate_get_hwp_cap() is called in intel_pstate_verify_cpu_policy() without checking the Broadwell mode and it overrides the initial turbo and max pstate values read from MSR_PLATFORM_INFO (the minimum P-state value still comes from MSR_PLATFORM_INFO if HWP is used even without the Broadwell mode). Moreover, hwp_cap_cached is used in some places for updating MSR_HWP_REQUEST without checking the Broadwell mode either. Effectively, the only difference made by the Broadwell HWP mode is skipping the hybrid initialization which may as well be achieved by avoiding to set pstate_funcs.get_cpu_scaling on Broadwell. Link: https://sashiko.dev/#/patchset/6005456.DvuYhMxLoT%40rafael.j.wysocki Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3057514.e9J7NaK4W3@rafael.j.wysocki
2026-07-15cpufreq: intel_pstate: Adjust the .adjust_perf() driver callbackRafael J. Wysocki
In some cases, the processor may not actually stick to the "desired" performance level programmed through the driver's .adjust_perf() callback and may go above it, which may not be desirable (for instance, there may be a UCLAMP_MAX limit set for the task currently running on the given CPU which should be respected). Address that by adjusting the .adjust_perf() callback to take an additional argument, max_perf, representing the maximum allowed performance level of the CPU and update the intel_pstate driver to take that argument into account as appropriate. Accordingly, adjust cpufreq_driver_adjust_perf() and the other existing user of .adjust_perf(), which is the amd-pstate driver (but the behavior of that driver is not changed). While at it, also update the cpufreq_driver_adjust_perf() documentation to reflect this change and some previous code changes that have not been taken into account in it. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Link: https://patch.msgid.link/6277654.lOV4Wx5bFT@rafael.j.wysocki [ rjw: Adjusted Rust function formatting ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-07-15s390/perf_cpum_cf: Add missing array_index_nospec() to __hw_perf_event_init()Sumanth Korikkar
ev variable is userspace controlled via event->attr.config and used as an array index after bounds checking, but without speculation barriers. Add the missing array_index_nospec() call to prevent speculative execution. Cc: stable@vger.kernel.org Fixes: 212188a596d1 ("[S390] perf: add support for s390x CPU counters") Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com> Acked-by: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2026-07-15s390/checksum: Fix csum_partial() without vector facilityVasily Gorbik
Currently csum_partial() calls csum_copy() with copy=false and dst=NULL. On machines without the vector facility, csum_copy() falls back to cksm(dst, ...), causing the checksum to be calculated from address zero instead of the source buffer. The VX implementation already checksums data loaded from src. Make the fallback do the same by passing src to cksm(). Fixes: dcd3e1de9d17 ("s390/checksum: provide csum_partial_copy_nocheck()") Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2026-07-15dmaengine: arm-dma350: enable ANYCH interrupt for shared IRQ wiringJun Guo
Enable DMANSECCTRL.INTREN_ANYCHINTR during probe so channel interrupts are propagated when integrators wire DMA-350 channels onto a shared IRQ line. Signed-off-by: Jun Guo <jun.guo@cixtech.com> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Link: https://patch.msgid.link/20260521072924.3000282-2-jun.guo@cixtech.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-07-15media: atomisp: Demote all broken kernel-doc commentsRicardo Ribalda
The atomisp code has been very heavily annotated in doxygen format. Unfortunately, both doxygen and kernel-doc use the same mark for signify the beginning of a comment (/**). As a result of this, kernel-doc gets confused when it parses atomisp and throws tons of warnings, which made us completely disable atomisp kernel-doc checks in Media-CI. Demote all the broken comments so we can have 100% coverage. Future patches can convert the doxygen annotations to kernel-doc if this is deemed useful. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: go7007: fix memory leaks on probe error pathsChen Changcheng
In go7007_register_encoder(), if any step after v4l2_device_register() fails (go7007_init_encoder, go7007_v4l2_ctrl_init, go7007_i2c_init, go7007_v4l2_init), the function returns directly without cleanup, leaking the registered V4L2 device and the control handler (if already initialized). Add cascade error labels that properly release resources according to how far initialization has progressed: - err_free_controls: frees the control handler - err_unregister_v4l2_dev: unregisters the V4L2 device (reached from any failure after v4l2_device_register) Signed-off-by: Chen Changcheng <chenchangcheng@kylinos.cn> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: s2255: check firmware size before reading trailing markerLei Huang
s2255_probe() reads a 4-byte marker and version from the last 8 bytes of the firmware blob (fw->data[fw_size - 8] and [fw_size - 4]). If the firmware file is shorter than 8 bytes, fw_size - 8 underflows and the access reads out of bounds. Validate the firmware size before indexing. Fixes: 14d962602c8b ("V4L/DVB (8752): s2255drv: firmware improvement patch") Cc: stable@vger.kernel.org Signed-off-by: Lei Huang <huanglei@kylinos.cn> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: videobuf2: move vb2_querybuf() kernel-doc to headerTharit Tangkijwanichakul
Move the function documentation for vb2_querybuf() from videobuf2-v4l2.c to videobuf2-v4l2.h to match other functions. Leaving the comment in the source file prevents the kernel-doc parser from extracting it - thus become missing from the generated HTML. Additionally, format the comment block to be the same style as other functions in the header. Signed-off-by: Tharit Tangkijwanichakul <tharitt97@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: stk1160: handle ESHUTDOWN gracefullyOliver Neukum
Give it its own error message. Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: stk1160: cleanup error handling in probeOliver Neukum
Do not replicate cleanup code. Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: cobalt: Avoid freeing ALSA private data twiceRuoyu Wang
snd_cobalt_card_create() stores cobsc in sc->private_data and installs snd_cobalt_card_private_free() as sc->private_free. From that point, snd_card_free(sc) releases cobsc through the ALSA card cleanup path. If cobalt_alsa_init() fails after snd_cobalt_card_create(), the err_exit_free path calls snd_card_free(sc) and then kfree(cobsc). That second free releases the same object again. Remove the explicit kfree(cobsc) and leave ownership with the ALSA card. This issue was found by a static analysis checker and confirmed by manual source review. Fixes: 85756a069c55 ("[media] cobalt: add new driver") Cc: stable@vger.kernel.org Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15staging: media: tegra-video: vi: fix probe failure on skipped last portHao-Qun Huang
tegra_vi_channels_alloc() iterates over port nodes and skips those whose reg property cannot be read or whose remote endpoint fails v4l2_fwnode_endpoint_parse(), leaving the negative result of the failed call in ret. If that happens on the last port node, the loop ends with ret still negative and tegra_vi_init() fails the whole VI probe. The same defective port earlier in the ports node is skipped silently, so probing succeeds or fails depending on the order of the port nodes. The CSI equivalent, tegra_csi_channels_alloc(), returns 0 unconditionally after its loop and does not have this problem. Use a separate variable for the per-port checks so that only fatal errors end up in ret. Fixes: 1ebaeb09830f ("media: tegra-video: Add support for external sensor capture") Fixes: 2ac4035a78c9 ("media: tegra-video: Add support for x8 captures with gang ports") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-fable-5 Signed-off-by: Hao-Qun Huang <alvinhuang0603@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15staging: media: tegra-video: fix of_node_put() on VIP parse errorsHao-Qun Huang
tegra_vip_channel_of_parse() initializes np from dev->of_node without taking a reference, but its error paths drop one through the err_node_put label. This underflows the refcount of the VIP device's OF node when endpoint parsing fails on a malformed device tree. The only reference the function takes on np is the success-path of_node_get() stored in vip->chan.of_node, and that one is already released by the tegra_vip_init() error path and by tegra_vip_exit(). Return errors directly instead of jumping to the bogus cleanup label. Fixes: e740d199cf0f ("staging: media: tegra-video: add support for Tegra20 parallel input") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-fable-5 Signed-off-by: Hao-Qun Huang <alvinhuang0603@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: go7007: defer the ALSA v4l2 put until card releaseShuangpeng Bai
go7007_snd_init() already takes a v4l2_device reference for the ALSA side, but go7007_snd_remove() drops it immediately after calling snd_card_free_when_closed(). That is too early when a userspace process still has the capture PCM open. The ALSA card and its PCM callbacks remain alive until the last file is closed, so the release path can still reach struct go7007 through pcm->private_data and call go7007_snd_hw_free() after the V4L2 release path has freed the object. Move the matching v4l2_device_put() to the ALSA card private_free callback so the existing ALSA reference covers the whole deferred card lifetime. Closes: https://lore.kernel.org/r/178144969601.60470.6005237146425573205@gmail.com Fixes: d5d3a7cc127d ("[media] go7007: fix unregister/disconnect handling") Cc: stable@vger.kernel.org Signed-off-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: usbtv: keep device alive while ALSA card existsShuangpeng Bai
The ALSA PCM callbacks store the driver state in pcm->private_data. An open PCM file can outlive USB disconnect because usbtv_audio_free() uses snd_card_free_when_closed(). The disconnect path can then drop the V4L2 device reference and free struct usbtv before ALSA releases the substream, so a later close dereferences freed memory in snd_usbtv_pcm_close(). Take a V4L2 device reference for the ALSA card and drop it from the card private_free callback. This keeps struct usbtv valid until ALSA has closed the remaining files and freed the card. Closes: https://lore.kernel.org/r/178144969601.60470.4852887710381872458@gmail.com Fixes: 63ddf68de52e ("[media] usbtv: add audio support") Cc: stable@vger.kernel.org Signed-off-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: video-i2c: fix kthread error pointer left in kthread_vid_cap on failureUday Khare
kthread_run() returns an ERR_PTR on failure, not NULL. When start_streaming() fails, data->kthread_vid_cap is left holding this error pointer instead of being cleared. This causes two subsequent bugs: 1. A future call to start_streaming() sees a non-NULL kthread_vid_cap and returns 0 (success) immediately, without actually starting the capture thread. 2. A call to stop_streaming() checks 'kthread_vid_cap == NULL' which is false for an error pointer, and proceeds to call kthread_stop() on the error pointer, leading to a kernel crash. Fix this by resetting kthread_vid_cap to NULL on failure before jumping to the error path. Fixes: 5cebaac60974 ("media: video-i2c: add video-i2c driver") Cc: stable@vger.kernel.org Signed-off-by: Uday Khare <udaykhare77@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: au0828: add support for Monoprice 106456 USB ATSC/QAM tunerJoseph Breihan
The Monoprice 106456 (board rev TV22AD-A, also sold as the AnyTV AUTV002) is a USB ATSC/QAM tuner that enumerates as 05e1:0400 and reports itself as a "Syntek Semiconductor USB 2.0 Video Capture Controller". The hardware is an Auvitek AU0828A bridge with an AU8522 demodulator and an NXP TDA18271HDC2 tuner at I2C address 0x60 -- the same demod/tuner combination as the existing Hauppauge Woodbury board. Adds board profile and the USB ID so the device binds. The digital frontend is electrically identical to the Woodbury, so share that board's au8522/tda18271 configuration and attach path rather than duplicating it. Tested with over-the-air 8VSB ATSC: it locks and streams a live 720p transport stream. Some 05e1:0400 units reportedly ship a Microtune MT2131 tuner with an AU8502 demodulator instead. This patch does not handle that variant, but it can't regress it either: 05e1:0400 matches no driver today, and on the MT2131 units tda18271_attach() just fails, so no frontend is registered. Signed-off-by: Joseph Breihan <linux@josephbreihan.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: stm32: dcmipp: Propagate runtime resume errorsPengpeng Hou
dcmipp_runtime_resume() can fail while preparing the device clocks, but dcmipp_resume() currently ignores the result of pm_runtime_force_resume() and always returns success. Return the pm_runtime_force_resume() result so system resume does not hide a failed runtime resume. Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: stm32: dcmi: Propagate runtime resume errorsPengpeng Hou
dcmi_runtime_resume() returns clock enable failures, but dcmi_resume() currently ignores the result of pm_runtime_force_resume() and always returns success. Return the pm_runtime_force_resume() result so system resume does not hide a failed runtime resume. Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: em28xx: fix use-after-free of dev_next->devlist on disconnectJiangong.Han
When a device with has_dual_ts=1 is probed and the is_audio_only path is taken, both dev and dev->dev_next are added to the global em28xx_devlist via em28xx_init_extension(). However, during disconnect, em28xx_close_extension(dev) only calls list_del(&dev->devlist), leaving dev->dev_next->devlist still linked in the global list. When dev_next is subsequently freed via kref_put(), its devlist entry becomes a dangling pointer in em28xx_devlist. The next device probe that calls em28xx_init_extension() triggers a list corruption BUG when list_add_tail detects the freed node. This bug was exposed by commit a368ecde8a50 ("USB: core: Fix duplicate endpoint bug by clearing reserved bits in the descriptor") which clears reserved bits in bEndpointAddress during endpoint parsing. This causes fuzzed endpoint addresses like 0xf3 to be normalized to 0x83, which em28xx interprets as a vendor audio endpoint, enabling the is_audio_only + has_dual_ts code path that was previously unreachable with such descriptors. Fix this by removing dev->dev_next->devlist from the global list in em28xx_close_extension() before the device is freed. Fixes: f410b4093fdd ("media: em28xx: split up em28xx_dvb_init to reduce stack size") Cc: stable@vger.kernel.org Reported-by: syzbot+99d6c66dbbc484f50e1c@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=99d6c66dbbc484f50e1c Signed-off-by: Jiangong.Han <jiangong.han@windriver.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: go7007: avoid undefined shifts in MPEG-4 headersYousef Alhouseen
The byte-alignment paths can call CODE_ADD() with a zero bit length. The macro then shifts an int by name.b, which can be 32 after the preceding bit was flushed. vti_bitlen() can likewise shift a signed int into its sign bit while searching for the bit length, and the package mask construction can shift by the full type width. Make zero-length additions a no-op, derive the bit length with fls(), and build the mask with GENMASK(). Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-07-15media: ivtv: stop VBI start-code scan before short tailPengpeng Hou
compress_sliced_buf() scans one byte at a time while testing a four-byte VBI start code. The final iterations can read beyond the remaining buffer tail. Stop the scan once fewer than four bytes remain. Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>