OSDN Git Service

greybus: loopback: Drop NULL check on container_of pointer
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Fri, 11 Dec 2015 13:46:50 +0000 (13:46 +0000)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 12 Dec 2015 00:16:01 +0000 (16:16 -0800)
container_of cannot return NULL and the pointer passed to this context uses
reference counter bumped inside a spinlock, so the base pointer will be
valid at this point.

Suggested-by: Johan Hovold <johan@hovoldconstulting.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c

index 6837291..0828772 100644 (file)
@@ -526,9 +526,6 @@ static void gb_loopback_async_operation_work(struct work_struct *work)
        struct gb_loopback_async_operation *op_async;
 
        op_async = container_of(work, struct gb_loopback_async_operation, work);
-       if (!op_async)
-               return;
-
        gb = op_async->gb;
        operation = op_async->operation;