* [PATCH 1/1] dlm: fix possible call to kfree() for non-initialized pointer
@ 2018-11-13 17:39 ` Denis V. Lunev
0 siblings, 0 replies; 2+ messages in thread
From: Denis V. Lunev @ 2018-11-13 17:39 UTC (permalink / raw)
To: linux-kernel
Cc: Denis V. Lunev, Christine Caulfield, David Teigland,
Konstantin Khorenko, cluster-devel
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@openvz.org>
CC: Christine Caulfield <ccaulfie@redhat.com>
CC: David Teigland <teigland@redhat.com>
CC: Konstantin Khorenko <khorenko@virtuozzo.com>
CC: cluster-devel@redhat.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH 1/1] dlm: fix possible call to kfree() for non-initialized pointer
@ 2018-11-13 17:39 ` Denis V. Lunev
0 siblings, 0 replies; 2+ messages in thread
From: Denis V. Lunev @ 2018-11-13 17:39 UTC (permalink / raw)
To: cluster-devel.redhat.com
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@openvz.org>
CC: Christine Caulfield <ccaulfie@redhat.com>
CC: David Teigland <teigland@redhat.com>
CC: Konstantin Khorenko <khorenko@virtuozzo.com>
CC: cluster-devel at redhat.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-13 17:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13 17:39 [PATCH 1/1] dlm: fix possible call to kfree() for non-initialized pointer Denis V. Lunev
2018-11-13 17:39 ` [Cluster-devel] " Denis V. Lunev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.