Commit 3db87236 authored by David Kozub's avatar David Kozub Committed by Jens Axboe

block: sed-opal: pass steps via argument rather than via opal_dev

The steps argument is only read by the next function, so it can
be passed directly as an argument rather than via opal_dev.

Normally, the steps is an array on the stack, so the pointer stops
being valid then the function that set opal_dev.steps returns.
If opal_dev.steps was not set to NULL before return it would become
a dangling pointer. When the steps are passed as argument this
becomes easier to see and more difficult to misuse.
Acked-by: default avatarJon Derrick <jonathan.derrick@intel.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarScott Bauer <sbauer@plzdonthack.me>
Signed-off-by: default avatarDavid Kozub <zub@linux.fjfi.cvut.cz>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 372be408
This diff is collapsed.
Markdown is supported
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