remarkable-linux/drivers/w1
David Fries 593ceb0c70 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 9be62e0b2f 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>
2014-04-16 14:07:51 -07:00
..
masters w1: mxc_w1: Enable driver compilation with COMPILE_TEST 2014-02-28 15:27:09 -08:00
slaves w1: Remove excess dependencies on W1 for masters and slaves 2014-02-28 15:27:09 -08:00
Kconfig Kconfig: replace "--- help ---" with "---help---" 2012-05-07 15:01:22 +02:00
Makefile
w1.c w1: small type cleanup in sysfs 2014-02-15 11:51:05 -08:00
w1.h w1: format for DocBook and fixes 2014-02-07 15:40:18 -08:00
w1_family.c w1: format for DocBook and fixes 2014-02-07 15:40:18 -08:00
w1_family.h w1: format for DocBook and fixes 2014-02-07 15:40:18 -08:00
w1_int.c w1: format for DocBook and fixes 2014-02-07 15:40:18 -08:00
w1_int.h MAINTAINERS: Evgeniy has moved 2011-08-25 16:25:33 -07:00
w1_io.c w1: format for DocBook and fixes 2014-02-07 15:40:18 -08:00
w1_log.h MAINTAINERS: Evgeniy has moved 2011-08-25 16:25:33 -07:00
w1_netlink.c w1: fix netlink refcnt leak on error path 2014-04-16 14:07:51 -07:00
w1_netlink.h w1: format for DocBook and fixes 2014-02-07 15:40:18 -08:00