linux-stable/include
Anders Roxell 368686a95e writeback: don't decrement wb->refcnt if !wb->bdi
This happened while running in qemu-system-aarch64, the AMBA PL011 UART
driver when enabling CONFIG_DEBUG_TEST_DRIVER_REMOVE.
arch_initcall(pl011_init) came before subsys_initcall(default_bdi_init),
devtmpfs' handle_remove() crashes because the reference count is a NULL
pointer only because wb->bdi hasn't been initialized yet.

Rework so that wb_put have an extra check if wb->bdi before decrement
wb->refcnt and also add a WARN_ON_ONCE to get a warning if it happens
again in other drivers.

Link: http://lkml.kernel.org/r/20181030113545.30999-2-anders.roxell@linaro.org
Fixes: 52ebea749a ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Co-developed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-12-28 12:11:46 -08:00
..
acpi Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-12-26 17:03:51 -08:00
asm-generic Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-12-26 18:08:18 -08:00
clocksource
crypto crypto: skcipher - remove remnants of internal IV generators 2018-12-23 11:52:45 +08:00
drm Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next 2018-12-13 10:06:34 +10:00
dt-bindings This round is dominated by NXP's i.MX clk drivers. We gained support for two or 2018-12-25 14:57:37 -08:00
keys
kvm KVM: arm/arm64: Remove arch timer workqueue 2018-12-19 17:47:07 +00:00
linux writeback: don't decrement wb->refcnt if !wb->bdi 2018-12-28 12:11:46 -08:00
math-emu
media media fixes for v4.20-rc8 2018-12-25 13:11:30 -08:00
memory
misc
net net: dccp: fix kernel crash on module load 2018-12-24 15:27:56 -08:00
pcmcia
ras
rdma
scsi
soc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-12-27 13:04:52 -08:00
sound ALSA: HD-Audio: SKL+: force HDaudio legacy or SKL+ driver selection 2018-12-19 18:07:23 +01:00
target
trace File locking changes for v4.21 2018-12-27 17:12:30 -08:00
uapi \n 2018-12-27 16:55:37 -08:00
video
xen xen: Introduce shared buffer helpers for page directory... 2018-12-18 12:15:55 -05:00