linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] pstore/blk: Fix return value check in pstore_blk_init()
@ 2021-06-17  0:54 Pu Lehui
  2021-06-17  3:19 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Pu Lehui @ 2021-06-17  0:54 UTC (permalink / raw)
  To: keescook, anton, ccross, tony.luck; +Cc: linux-kernel, pulehui, zhangjinhao2

Fix the return value check which testing the wrong variable
in pstore_blk_init().

Signed-off-by: Pu Lehui <pulehui@huawei.com>
---
 fs/pstore/blk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c
index ccfb11ee4d50..d5e22e6209a6 100644
--- a/fs/pstore/blk.c
+++ b/fs/pstore/blk.c
@@ -287,7 +287,7 @@ static int __init pstore_blk_init(void)
 		struct pstore_device_info *best_effort_dev;
 
 		best_effort_dev = kzalloc(sizeof(*best_effort_dev), GFP_KERNEL);
-		if (!best_effort) {
+		if (!best_effort_dev) {
 			ret = -ENOMEM;
 			goto unlock;
 		}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-17  3:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  0:54 [PATCH -next] pstore/blk: Fix return value check in pstore_blk_init() Pu Lehui
2021-06-17  3:19 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).