sch_tbf: Fix potential memory leak in tbf_change().
authorHiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Wed, 26 Feb 2014 12:43:42 +0000 (21:43 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Mar 2014 04:44:01 +0000 (21:44 -0700)
commitd93114e2bc720ccc75ff8defe490fbc987935bcb
treeb34598a2f82144db8ab9fa190d25ffbc19d41ffd
parent4de185063bc4585ef3b56775ec0f8057031f8cd5
sch_tbf: Fix potential memory leak in tbf_change().

[ Upstream commit 724b9e1d75ab3401aaa081bd4efb440c1b3509db ]

The allocated child qdisc is not freed in error conditions.
Defer the allocation after user configuration turns out to be
valid and acceptable.

Fixes: cc106e441a63b ("net: sched: tbf: fix the calculation of max_size")
Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Cc: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/sch_tbf.c