Skip to content
Commit 977b7e3a authored by Wu Fengguang's avatar Wu Fengguang
Browse files

writeback: fix dereferencing NULL bdi->dev on trace_writeback_queue

When a SD card is hot removed without umount, del_gendisk() will call
bdi_unregister() without destroying/freeing it. This leaves the bdi in
the bdi->dev = NULL, bdi->wb.task = NULL, bdi->bdi_list removed state.

When sync(2) gets the bdi before bdi_unregister() and calls
bdi_queue_work() after the unregister, trace_writeback_queue will be
dereferencing the NULL bdi->dev. Fix it with a simple test for NULL.

LKML-reference: http://lkml.org/lkml/2012/1/18/346


Cc: stable@kernel.org
Reported-by: default avatarRabin Vincent <rabin@rab.in>
Tested-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
parent 3310225d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment