rsxx: Use struct_size() in vmalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Thu, 13 May 2021 20:37:30 +0000 (15:37 -0500)
committerJens Axboe <axboe@kernel.dk>
Mon, 24 May 2021 12:47:30 +0000 (06:47 -0600)
commit8184035805dc87dd826101b930d3dce97758f7b1
tree21d91cdd62035c1fb6b81a1d2154c55681691cbc
parentd97e594c51660bea510a387731637b894651e4b5
rsxx: Use struct_size() in vmalloc()

Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows
that, in the worst scenario, could lead to heap overflows.

This code was detected with the help of Coccinelle and, audited and
fixed manually.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20210513203730.GA212128@embeddedor
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/rsxx/dma.c