[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20181113173950.7165-1-den@openvz.org>
Date: Tue, 13 Nov 2018 20:39:50 +0300
From: "Denis V. Lunev" <den@...nvz.org>
To: linux-kernel@...r.kernel.org
Cc: "Denis V. Lunev" <den@...nvz.org>,
Christine Caulfield <ccaulfie@...hat.com>,
David Teigland <teigland@...hat.com>,
Konstantin Khorenko <khorenko@...tuozzo.com>,
cluster-devel@...hat.com
Subject: [PATCH 1/1] dlm: fix possible call to kfree() for non-initialized pointer
Technically dlm_config_nodes() could return error and keep nodes
uninitialized. After that on the fail path of we'll call kfree()
for that uninitialized value.
The patch is simple - we should just initialize nodes with NULL.
Signed-off-by: Denis V. Lunev <den@...nvz.org>
CC: Christine Caulfield <ccaulfie@...hat.com>
CC: David Teigland <teigland@...hat.com>
CC: Konstantin Khorenko <khorenko@...tuozzo.com>
CC: cluster-devel@...hat.com
---
fs/dlm/member.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/dlm/member.c b/fs/dlm/member.c
index 3fda3832cf6a..2ce33088f8bb 100644
--- a/fs/dlm/member.c
+++ b/fs/dlm/member.c
@@ -671,7 +671,7 @@ int dlm_ls_stop(struct dlm_ls *ls)
int dlm_ls_start(struct dlm_ls *ls)
{
struct dlm_recover *rv, *rv_old;
- struct dlm_config_node *nodes;
+ struct dlm_config_node *nodes = NULL;
int error, count;
rv = kzalloc(sizeof(*rv), GFP_NOFS);
--
2.17.1
Powered by blists - more mailing lists