Skip to content

Commit 5acdbe6

Browse files
Javier Gonzálezgregkh
authored andcommitted
lightnvm: initialize ppa_addr in dev_to_generic_addr()
commit 5389a1dfb39786df08d4f6a482bd2734b1b50e33 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d255fff commit 5acdbe6

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

include/linux/lightnvm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ static inline struct ppa_addr dev_to_generic_addr(struct nvm_dev *dev,
310310
{
311311
struct ppa_addr l;
312312

313+
l.ppa = 0;
313314
/*
314315
* (r.ppa << X offset) & X len bitmask. X eq. blk, pg, etc.
315316
*/

0 commit comments

Comments
 (0)