greybus: operation: fix another cancellation use-after-free
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 14 Jul 2015 13:43:23 +0000 (15:43 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 15 Jul 2015 19:39:13 +0000 (12:39 -0700)
commitfffc151381473384629d78cb89b7f7bbb9dc53b0
treeff872a539ca01725fb5eed5c368a214c3ad213b7
parenta5192032a2a9475c837c2b4b6fc3df02d617c7b0
greybus: operation: fix another cancellation use-after-free

An incoming operation could already be scheduled even if
gb_operation_result_set succeeds as its initial status is -EINPROGRESS.

Avoid potential use-after-free by never dropping the reference count for
incoming operations as part of cancellation.

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