No description
  • C 96.9%
  • Assembly 0.9%
  • Rust 0.6%
  • Shell 0.6%
  • Python 0.5%
  • Other 0.3%
Find a file
Fan Wu 9dcfdf6c59 power: supply: bq256xx: drain usb_work before freeing the charger
commit 2dd6cd8237 upstream.

The USB-PHY notifier queues usb_work, whose handler calls
power_supply_changed(bq->charger). The reset devm action only unregisters
the notifier and was registered before the power supplies, so devm frees
bq->charger on unwind before the action runs; a usb_work still queued can
then dereference it.

Register the reset action after the power supplies, so it unregisters
the notifiers and drains usb_work before the supplies are released.
Initialize usb_work and obtain the PHY references before registering
the notifiers, so the worker cannot run before the supplies exist.

Found by static analysis.

Fixes: 32e4978bb9 ("power: supply: bq256xx: Introduce the BQ256XX charger driver")
Cc: stable@vger.kernel.org
Assisted-by: Codex:gpt-5.6
Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
Link: https://patch.msgid.link/20260804145511.103470-1-fanwu01@zju.edu.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-09-14 13:20:11 +02:00
arch openrisc: fix arbitrary kernel memory access via or1k_atomic syscall 2026-09-14 13:20:10 +02:00
block partitions: aix: bound the pp_count scan to the ppe array 2026-07-24 15:51:24 +02:00
certs X.509: Fix validation of ASN.1 certificate header 2026-07-24 15:51:59 +02:00
crypto crypto: ccm - Set rfc4309 maxauthsize from child 2026-08-23 14:17:31 +02:00
Documentation mm/swap: reject swapon() on filesystem-level encrypted files 2026-09-02 14:27:28 +02:00
drivers power: supply: bq256xx: drain usb_work before freeing the charger 2026-09-14 13:20:11 +02:00
fs lockd: pin next file across nlm_inspect_file lock-drop 2026-09-14 13:20:11 +02:00
include sctp: fix stream->outcnt underflow on duplicate RECONF responses 2026-09-14 13:20:11 +02:00
init bootconfig: move xbc_snprint_cmdline() to lib/bootconfig.c 2026-08-23 14:17:24 +02:00
io_uring io_uring/io-wq: fix worker accounting when canceling creation callbacks 2026-09-02 14:27:25 +02:00
ipc ipc/shm: serialize orphan cleanup with shm_nattch updates 2026-06-19 13:33:38 +02:00
kernel cpufreq: schedutil: Fix rate limit overflow 2026-09-14 13:20:08 +02:00
lib lib/ucs2_string.c: fix out-of-bounds read in ucs2_strnlen() 2026-09-14 13:20:04 +02:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
mm mm: memcg: stop reclaim when a limit update is superseded 2026-09-14 13:20:03 +02:00
net sctp: fix stream->outcnt underflow on duplicate RECONF responses 2026-09-14 13:20:11 +02:00
samples tracing/events: Fix to check the simple_tsk_fn creation 2026-07-24 15:51:42 +02:00
scripts kconfig: fix potential NULL pointer dereference in conf_askvalue 2026-07-24 15:51:28 +02:00
security selinux: switch two allocations to use kzalloc_objs() 2026-09-02 14:27:26 +02:00
sound ALSA: aloop: Fix racy access at PCM trigger 2026-09-14 13:20:03 +02:00
tools tools/compiler: match glibc 2.42 definition of __attribute_const__ 2026-09-14 13:20:04 +02:00
usr kbuild: hdrcheck: fix cross build with clang 2025-06-27 11:05:22 +01:00
virt KVM: Rename mmu_notifier_* to mmu_invalidate_* 2026-08-27 14:28:21 +02:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore Remove *.orig pattern from .gitignore 2024-10-17 15:11:10 +02:00
.mailmap mailmap: add Andrej Shadura 2021-10-18 20:22:03 -10:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Daniel Drake to credits 2021-09-21 08:34:58 +03:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS staging: rtl8712: Remove driver using deprecated API wext 2025-12-07 06:09:36 +09:00
Makefile Linux 5.15.220 2026-09-02 14:27:29 +02:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.