linux/drivers/md/bcache
Liequan Che b2e382ae12 bcache: revert replacing IS_ERR_OR_NULL with IS_ERR again
Commit 028ddcac47 ("bcache: Remove unnecessary NULL point check in
node allocations") leads a NULL pointer deference in cache_set_flush().

1721         if (!IS_ERR_OR_NULL(c->root))
1722                 list_add(&c->root->list, &c->btree_cache);

>From the above code in cache_set_flush(), if previous registration code
fails before allocating c->root, it is possible c->root is NULL as what
it is initialized. __bch_btree_node_alloc() never returns NULL but
c->root is possible to be NULL at above line 1721.

This patch replaces IS_ERR() by IS_ERR_OR_NULL() to fix this.

Fixes: 028ddcac47 ("bcache: Remove unnecessary NULL point check in node allocations")
Signed-off-by: Liequan Che <cheliequan@inspur.com>
Cc: stable@vger.kernel.org
Cc: Zheng Wang <zyytlz.wz@163.com>
Reviewed-by: Mingzhe Zou <mingzhe.zou@easystack.cn>
Signed-off-by: Coly Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20241202115638.28957-1-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-12-03 15:06:27 -07:00
..
alloc.c bcache: update min_heap_callbacks to use default builtin swap 2024-11-05 17:12:36 -08:00
bcache_ondisk.h
bcache.h bcache: remove heap-related macros and switch to generic min_heap 2024-06-24 22:25:00 -07:00
bset.c bcache: update min_heap_callbacks to use default builtin swap 2024-11-05 17:12:36 -08:00
bset.h bcache: remove heap-related macros and switch to generic min_heap 2024-06-24 22:25:00 -07:00
btree.c bcache: remove heap-related macros and switch to generic min_heap 2024-06-24 22:25:00 -07:00
btree.h
debug.c
debug.h
extents.c bcache: update min_heap_callbacks to use default builtin swap 2024-11-05 17:12:36 -08:00
extents.h
features.c
features.h
io.c
journal.c closures: CLOSURE_CALLBACK() to fix type punning 2023-11-24 00:29:58 -05:00
journal.h
Kconfig lib/min_heap: introduce non-inline versions of min heap API functions 2024-11-05 17:12:34 -08:00
Makefile
movinggc.c bcache: update min_heap_callbacks to use default builtin swap 2024-11-05 17:12:36 -08:00
request.c bcache: call force_wake_up_gc() if necessary in check_should_bypass() 2024-05-28 06:55:59 -06:00
request.h closures: CLOSURE_CALLBACK() to fix type punning 2023-11-24 00:29:58 -05:00
stats.c
stats.h
super.c bcache: revert replacing IS_ERR_OR_NULL with IS_ERR again 2024-12-03 15:06:27 -07:00
sysfs.c bcache: remove heap-related macros and switch to generic min_heap 2024-06-24 22:25:00 -07:00
sysfs.h
trace.c
util.c bcache: fix typo 2024-06-24 22:24:56 -07:00
util.h bcache: remove heap-related macros and switch to generic min_heap 2024-06-24 22:25:00 -07:00
writeback.c bcache: remove heap-related macros and switch to generic min_heap 2024-06-24 22:25:00 -07:00
writeback.h