From patchwork Wed Jul 25 15:22:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10544183 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E19A1822 for ; Wed, 25 Jul 2018 15:43:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B85E2A4D1 for ; Wed, 25 Jul 2018 15:43:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FE312A4D2; Wed, 25 Jul 2018 15:43:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1EED2A4FC for ; Wed, 25 Jul 2018 15:43:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728586AbeGYQzq (ORCPT ); Wed, 25 Jul 2018 12:55:46 -0400 Received: from gateway23.websitewelcome.com ([192.185.49.218]:19857 "EHLO gateway23.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728568AbeGYQzq (ORCPT ); Wed, 25 Jul 2018 12:55:46 -0400 X-Greylist: delayed 1209 seconds by postgrey-1.27 at vger.kernel.org; Wed, 25 Jul 2018 12:55:46 EDT Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 2723F850F for ; Wed, 25 Jul 2018 10:23:29 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id iLcSf4sjybXuJiLcyfBRmf; Wed, 25 Jul 2018 10:23:28 -0500 X-Authority-Reason: nr=8 Received: from [189.250.102.68] (port=41548 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1fiLcS-000nok-45; Wed, 25 Jul 2018 10:22:28 -0500 Date: Wed, 25 Jul 2018 10:22:27 -0500 From: "Gustavo A. R. Silva" To: Ka-Cheong Poon , Santosh Shilimkar , "David S. Miller" Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] rds: send: Fix dead code in rds_sendmsg Message-ID: <20180725152227.GA26303@embeddedor.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.250.102.68 X-Source-L: No X-Exim-ID: 1fiLcS-000nok-45 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.102.68]:41548 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, code at label *out* is unreachable. Fix this by updating variable *ret* with -EINVAL, so the jump to *out* can be properly executed instead of directly returning from function. Addresses-Coverity-ID: 1472059 ("Structurally dead code") Fixes: 1e2b44e78eea ("rds: Enable RDS IPv6 support") Signed-off-by: Gustavo A. R. Silva Acked-by: Santosh Shilimkar --- net/rds/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rds/send.c b/net/rds/send.c index 9604e1f..18e2b4d 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -1126,7 +1126,7 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len) if (addr4 == htonl(INADDR_ANY) || addr4 == htonl(INADDR_BROADCAST) || IN_MULTICAST(ntohl(addr4))) { - return -EINVAL; + ret = -EINVAL; goto out; } }