From: Tushar Gohad Date: Thu, 7 Jul 2011 15:38:52 +0000 (+0000) Subject: XFRM: Fix memory leak in xfrm_state_update X-Git-Tag: v3.0~41^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fcbc63701b01e913e6a13937f765fabf9c969c5;p=pandora-kernel.git XFRM: Fix memory leak in xfrm_state_update Upon "ip xfrm state update ..", xfrm_add_sa() takes an extra reference on the user-supplied SA and forgets to drop the reference when xfrm_state_update() returns 0. This leads to a memory leak as the parameter SA is never freed. This change attempts to fix the leak by calling __xfrm_state_put() when xfrm_state_update() updates a valid SA (err = 0). The parameter SA is added to the gc list when the final reference is dropped by xfrm_add_sa() upon completion. Signed-off-by: Tushar Gohad Acked-by: Herbert Xu Signed-off-by: David S. Miller --- Reading git-diff-tree failed