Commit 5389a1df authored by Javier González's avatar Javier González Committed by Jens Axboe

lightnvm: initialize ppa_addr in dev_to_generic_addr()

The ->reserved bit is not initialized when allocated on stack.
This may lead targets to misinterpret the PPA as cached.
Signed-off-by: default avatarJavier González <javier@cnexlabs.com>
Signed-off-by: default avatarMatias Bjørling <m@bjorling.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 529435e8
...@@ -385,6 +385,7 @@ static inline struct ppa_addr dev_to_generic_addr(struct nvm_dev *dev, ...@@ -385,6 +385,7 @@ static inline struct ppa_addr dev_to_generic_addr(struct nvm_dev *dev,
{ {
struct ppa_addr l; struct ppa_addr l;
l.ppa = 0;
/* /*
* (r.ppa << X offset) & X len bitmask. X eq. blk, pg, etc. * (r.ppa << X offset) & X len bitmask. X eq. blk, pg, etc.
*/ */
......
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