]> git.ipfire.org Git - people/arne_f/kernel.git/commit
w1: fix w1_send_slave dropping a slave id
authorDavid Fries <David@Fries.net>
Thu, 16 Jan 2014 04:29:12 +0000 (22:29 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 May 2014 14:51:41 +0000 (07:51 -0700)
commit6733ac581418cfd8d7bef57c22fc2e0d673c4272
tree901d07fe2fe2e1af5f69ca18259fa1b0d78d967b
parent3b015ff0243274791bb5d9357f517e43babcf705
w1: fix w1_send_slave dropping a slave id

commit 6b355b33a64fd6d8ead2b838ec16fb9b551f71e8 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>
drivers/w1/w1_netlink.c