From: Jesper Juhl Date: Sun, 12 Jun 2011 04:28:16 +0000 (+0000) Subject: ieee802154: Don't leak memory in ieee802154_nl_fill_phy X-Git-Tag: v3.0-rc4~5^2~29 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9cabe52c27cf834137f3aaa46da23bcf32284e8;p=pandora-kernel.git ieee802154: Don't leak memory in ieee802154_nl_fill_phy In net/ieee802154/nl-phy.c::ieee802154_nl_fill_phy() I see two small issues. 1) If the allocation of 'buf' fails we may just as well return -EMSGSIZE directly rather than jumping to 'out:' and do a pointless kfree(0). 2) We do not free 'buf' unless we jump to one of the error labels and this leaks memory. This patch should address both. Signed-off-by: Jesper Juhl Acked-by: Dmitry Eremin-Solenikov Signed-off-by: David S. Miller --- Reading git-diff-tree failed