lightnvm: initialize ppa_addr in dev_to_generic_addr()
authorJavier González <javier@cnexlabs.com>
Thu, 7 Jul 2016 07:54:09 +0000 (09:54 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 7 Jul 2016 14:51:52 +0000 (08:51 -0600)
The ->reserved bit is not initialized when allocated on stack.
This may lead targets to misinterpret the PPA as cached.

Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
include/linux/lightnvm.h

index 9c56148d6f638d0b7608fb49feeed3f249d2ea2d..cee4c8de34d5fd50aa0779124e923ff3b7635a1c 100644 (file)
@@ -385,6 +385,7 @@ static inline struct ppa_addr dev_to_generic_addr(struct nvm_dev *dev,
 {
        struct ppa_addr l;
 
+       l.ppa = 0;
        /*
         * (r.ppa << X offset) & X len bitmask. X eq. blk, pg, etc.
         */