summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDavid Fries <David@Fries.net>2014-04-08 22:37:07 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-16 14:07:51 -0700
commit593ceb0c7046c640cf463022189428a45219f595 (patch)
treebda2945990912476effbe15289da3d4072c568d0 /tools
parenta82cb8b91a37b6015f171a90dc4670e4c8e12e12 (diff)
downloadlwn-593ceb0c7046c640cf463022189428a45219f595.tar.gz
lwn-593ceb0c7046c640cf463022189428a45219f595.zip
w1: fix netlink refcnt leak on error path
If the message type is W1_MASTER_CMD or W1_SLAVE_CMD, then a reference is taken when searching for the slave or master device. If there isn't any following data m->len (mlen is a copy) is 0 and packing up the message for later execution is skipped leaving nothing to decrement the reference counts. Way back when, m->len was checked before the search that increments the reference count, but W1_LIST_MASTERS has no additional data, the check was moved in 9be62e0b2fadaf5ff causing this bug. This change reorders to put the check before the reference count is incremented avoiding the problem. Signed-off-by: David Fries <David@Fries.net> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions