dm: Use kzalloc for all structs with embedded biosets/mempools
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 5 Jun 2018 09:26:33 +0000 (05:26 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Nov 2019 11:18:01 +0000 (12:18 +0100)
commit7ff8f2104cc9f371d64fc87a3f9a08e6e88f6614
tree141d5bd9d79184bf13dd070c9e928ce3da105667
parent37524335ac39dd4a77c305735c2ce5522278d674
dm: Use kzalloc for all structs with embedded biosets/mempools

[ Upstream commit d377535405686f735b90a8ad4ba269484cd7c96e ]

mempool_init()/bioset_init() require that the mempools/biosets be zeroed
first; they probably should not _require_ this, but not allocating those
structs with kzalloc is a fairly nonsensical thing to do (calling
mempool_exit()/bioset_exit() on an uninitialized mempool/bioset is legal
and safe, but only works if said memory was zeroed.)

Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-bio-prison.c
drivers/md/dm-io.c
drivers/md/dm-kcopyd.c
drivers/md/dm-region-hash.c
drivers/md/dm-snap.c
drivers/md/dm-thin.c