greybus: operation: fix operation look-up race
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 14 Jul 2015 13:43:33 +0000 (15:43 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 15 Jul 2015 19:39:13 +0000 (12:39 -0700)
commit3325a4ad7122acdbfae5360cafc7152b32eefd57
treedec4e84f3b22a87347942d36ded0454162c7b98b
parent7f1b67cd535673cef9b9c9fa772d04015f64bd8e
greybus: operation: fix operation look-up race

Make sure to fully initialise the operation before adding it to the
active list when sending a request.

The operation should be fully initialised before adding it to the active
list to avoid racing with operation look up when receiving a response,
something which could potentially lead to a match against some earlier
(or intermediate) value of the id field.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/operation.c