On Wed, Jan 31, 2024 at 05:52:11PM +0300, Dan Carpenter wrote: > Hello Kent Overstreet, > > The patch 1c6fdbd8f246: "bcachefs: Initial commit" from Mar 16, 2017 > (linux-next), leads to the following Smatch static checker warning: > > fs/bcachefs/btree_io.c:1672 bch2_btree_node_read() potential NULL > container_of 'bio' > fs/bcachefs/btree_io.c:2165 __bch2_btree_node_write() potential NULL > container_of 'bio_alloc_bioset()' > fs/bcachefs/ec.c:734 ec_block_io() potential NULL container_of > 'bio_alloc_bioset()' > fs/bcachefs/fs-io-buffered.c:489 bch2_writepage_io_alloc() potential NULL > container_of 'bio_alloc_bioset()' > fs/bcachefs/fs-io.c:81 bch2_inode_flush_nocow_writes_async() potential NULL > container_of 'bio_alloc_bioset()' > fs/bcachefs/io_write.c:407 bch2_submit_wbio_replicas() potential NULL > container_of 'bio_alloc_clone()' > fs/bcachefs/fs-io-direct.c:622 bch2_direct_write() potential NULL > container_of 'bio'
bio_alloc_bioset() is mempool backed and can't return NULL
