Skip to content
Commit 6a365874 authored by Stephen Kitt's avatar Stephen Kitt Committed by Jens Axboe
Browse files

drbd: fifo_alloc() should use struct_size



Switching to struct_size for the allocation in fifo_alloc avoids
hard-coding the type of fifo_buffer.values in fifo_alloc. It also
provides overflow protection; to avoid pessimistic code being
generated by the compiler as a result, this patch also switches
fifo_size to unsigned, propagating the change as appropriate.

Reviewed-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: default avatarStephen Kitt <steve@sk2.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a258edbc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment