w1_therm reference count family data
authorDavid Fries <David@Fries.net>
Sat, 9 May 2015 00:51:50 +0000 (19:51 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:11 +0000 (09:29 -0700)
commit7a8599a5a88f7996db19cf8ecc466fd95e9dcc4e
tree337f0474b709e7705b391f3e637c6d6d63c8cb3e
parentf2cb7e30813040794190995f54f42a8addeec8da
w1_therm reference count family data

commit f7134eea05b2fb4a2c0935f8a540539fff01f3eb upstream.

A temperature conversion can take 750 ms and when possible the
w1_therm slave driver drops the bus_mutex to allow other bus
operations, but that includes operations such as a periodic slave
search, which can remove this slave when it is no longer detected.
If that happens the sl->family_data will be freed and set to NULL
causing w1_slave_show to crash when it wakes up.

Signed-off-by: David Fries <David@Fries.net>
Reported-By: Thorsten Bschorr <thorsten@bschorr.de>
Tested-by: Thorsten Bschorr <thorsten@bschorr.de>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/slaves/w1_therm.c