9p/rdma: remove useless check in cm_event_handler
authorDominique Martinet <dominique.martinet@cea.fr>
Fri, 7 Sep 2018 15:26:50 +0000 (00:26 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jul 2019 07:55:37 +0000 (09:55 +0200)
[ Upstream commit 473c7dd1d7b59ff8f88a5154737e3eac78a96e5b ]

the client c is always dereferenced to get the rdma struct, so c has to
be a valid pointer at this point.
Gcc would optimize that away but let's make coverity happy...

Link: http://lkml.kernel.org/r/1536339057-21974-3-git-send-email-asmadeus@codewreck.org
Addresses-Coverity-ID: 102778 ("Dereference before null check")
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/9p/trans_rdma.c

index 9662c27..8e4313a 100644 (file)
@@ -254,8 +254,7 @@ p9_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
        case RDMA_CM_EVENT_DISCONNECTED:
                if (rdma)
                        rdma->state = P9_RDMA_CLOSED;
-               if (c)
-                       c->status = Disconnected;
+               c->status = Disconnected;
                break;
 
        case RDMA_CM_EVENT_TIMEWAIT_EXIT: