dm crypt: use struct_size() when allocating encryption context
authorZhengyuan Liu <liuzhengyuan@kylinos.cn>
Wed, 12 Jun 2019 06:14:45 +0000 (14:14 +0800)
committerMike Snitzer <snitzer@redhat.com>
Tue, 9 Jul 2019 18:08:40 +0000 (14:08 -0400)
commit9c81c99b242f1241e18573d1ce29f7479c168e38
treed1101ca89132efca5d6d64e10389c602e2f36483
parent5f1c56b34e81e2d63f345f7ad6c5c7971c3c314d
dm crypt: use struct_size() when allocating encryption context

Use struct_size() to avoid open-coded equivalent that is prone to a type
mistake.

Signed-off-by: Zhengyuan Liu <liuzhengyuan@kylinos.cn>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-crypt.c