linux/drivers/w1
David Fries d98eafe3ae w1: fix w1_send_slave dropping a slave id
commit 6b355b33a6 upstream.

Previous logic,
if (avail > 8) {
	store slave;
	return;
}
send data; clear;

The logic error is, if there isn't space send the buffer and clear,
but the slave wasn't added to the now empty buffer loosing that slave
id.  It also should have been "if (avail >= 8)" because when it is 8,
there is space.

Instead, if there isn't space send and clear the buffer, then there is
always space for the slave id.

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-05-06 07:59:26 -07:00
..
masters drivers/w1/masters/w1-gpio.c: add strong pullup emulation 2014-01-23 16:37:04 -08:00
slaves w1: slaves: w1_ds2781: convert to use w1_family_ops.groups 2013-08-22 11:05:44 -07:00
Kconfig
Makefile
w1_family.c
w1_family.h w1: add attribute groups to struct w1_family_ops 2013-08-22 11:05:42 -07:00
w1_int.c drivers/w1/masters/w1-gpio.c: add strong pullup emulation 2014-01-23 16:37:04 -08:00
w1_int.h
w1_io.c
w1_log.h
w1_netlink.c w1: fix w1_send_slave dropping a slave id 2014-05-06 07:59:26 -07:00
w1_netlink.h
w1.c drivers: w1: make w1_slave::flags long to avoid memory corruption 2013-11-13 12:09:35 +09:00
w1.h drivers: w1: make w1_slave::flags long to avoid memory corruption 2013-11-13 12:09:35 +09:00