Liequan Che b2e382ae12 bcache: revert replacing IS_ERR_OR_NULL with IS_ERR again
Commit 028ddcac477b ("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: 028ddcac477b ("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
..
2024-04-01 11:53:37 -06:00
2024-11-18 16:50:08 -08:00
2024-06-26 11:32:39 -04:00
2024-05-09 09:10:58 -04:00
2023-02-14 14:23:07 -05:00
2023-02-14 14:23:07 -05:00
2024-09-27 09:12:51 -07:00
2024-02-20 14:22:51 -05:00
2024-06-26 11:32:39 -04:00
2024-02-20 14:22:51 -05:00
2024-09-27 09:12:51 -07:00
2023-02-14 14:23:06 -05:00
2024-11-20 11:38:04 +01:00
2024-11-20 11:38:04 +01:00
2024-11-20 11:38:04 +01:00
2024-11-18 16:50:08 -08:00
2024-11-05 16:08:38 -08:00
2024-11-19 10:30:02 -07:00
2024-11-19 10:30:02 -07:00
2024-11-30 15:47:29 -08:00