diff mbox

[03/17] lightnvm: initialize ppa_addr in dev_to_generic_addr()

Message ID 1467878063-22919-4-git-send-email-m@bjorling.me (mailing list archive)
State New, archived
Headers show

Commit Message

Matias Bjørling July 7, 2016, 7:54 a.m. UTC
From: Javier González <javier@cnexlabs.com>

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>
---
 include/linux/lightnvm.h | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index 9c56148..cee4c8d 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -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.
 	 */