From 9d677cf604212313f41097e2f542e1923d717086 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Thu, 15 Jan 2015 21:18:27 -0500 Subject: [PATCH] greybus: Add FIXME warnings for possible NULL dereferences Signed-off-by: Bill Pemberton Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/operation.c | 1 + drivers/staging/greybus/protocol.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index 44cfd50..f014906 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -742,6 +742,7 @@ int gb_operation_response_send(struct gb_operation *operation, int errno) } } + /* FIXME operation->response could still be NULL here */ /* Fill in the response header and send it */ operation->response->header->result = gb_operation_errno_map(errno); diff --git a/drivers/staging/greybus/protocol.c b/drivers/staging/greybus/protocol.c index 562401d..b8ae707 100644 --- a/drivers/staging/greybus/protocol.c +++ b/drivers/staging/greybus/protocol.c @@ -188,6 +188,9 @@ void gb_protocol_put(struct gb_protocol *protocol) if (protocol) WARN_ON(!protocol_count); else + /* FIXME a different message is needed since this one + * will result in a NULL dereference + */ pr_err("protocol id %hhu version %hhu.%hhu not found\n", protocol->id, major, minor); } -- 2.7.4