aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2013-01-25 18:44:57 +0300
committerSimon Horman <[email protected]>2013-01-28 10:14:37 +0900
commitb425df4cdd953a400d814b4474c9d3ec04481858 (patch)
treeec7a8fab76d06b6841f8c4a35d98e197794d746c
parent5b76c4948fe6977bead2359c2054f3e6a2dcf3d0 (diff)
ipvs: freeing uninitialized pointer on error
If state != IP_VS_STATE_BACKUP then tinfo->buf is uninitialized. If kthread_run() fails then it means we free random memory resulting in an oops. Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Julian Anastasov <[email protected]> Signed-off-by: Simon Horman <[email protected]>
-rw-r--r--net/netfilter/ipvs/ip_vs_sync.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index effa10c9e4e3..44fd10c539ac 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -1795,6 +1795,8 @@ int start_sync_thread(struct net *net, int state, char *mcast_ifn, __u8 syncid)
GFP_KERNEL);
if (!tinfo->buf)
goto outtinfo;
+ } else {
+ tinfo->buf = NULL;
}
tinfo->id = id;