From patchwork Tue May 28 14:24:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10965055 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 C659592A for ; Tue, 28 May 2019 14:24:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B70B21FE95 for ; Tue, 28 May 2019 14:24:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AABD5285AD; Tue, 28 May 2019 14:24:46 +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 9A50C1FE95 for ; Tue, 28 May 2019 14:24:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727665AbfE1OYo (ORCPT ); Tue, 28 May 2019 10:24:44 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:37092 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727614AbfE1OYn (ORCPT ); Tue, 28 May 2019 10:24:43 -0400 Received: from ramsan ([84.194.111.163]) by xavier.telenet-ops.be with bizsmtp id HqQS2000L3XaVaC01qQSyd; Tue, 28 May 2019 16:24:42 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1hVd1e-00058J-3j; Tue, 28 May 2019 16:24:26 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1hVd1e-00057Q-26; Tue, 28 May 2019 16:24:26 +0200 From: Geert Uytterhoeven To: Igor Konopko , David Howells , "Mohit P . Tahiliani" , Takashi Sakamoto , Eran Ben Elisha , Matias Bjorling , Jiri Pirko , "David S . Miller" , Jamal Hadi Salim , Cong Wang , Clemens Ladisch , Jaroslav Kysela , Takashi Iwai , Joe Perches , Arnd Bergmann , Dan Carpenter Cc: linux-block@vger.kernel.org, netdev@vger.kernel.org, linux-afs@lists.infradead.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/5] rxrpc: Fix uninitialized error code in rxrpc_send_data_packet() Date: Tue, 28 May 2019 16:24:21 +0200 Message-Id: <20190528142424.19626-3-geert@linux-m68k.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190528142424.19626-1-geert@linux-m68k.org> References: <20190528142424.19626-1-geert@linux-m68k.org> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With gcc 4.1: net/rxrpc/output.c: In function ‘rxrpc_send_data_packet’: net/rxrpc/output.c:338: warning: ‘ret’ may be used uninitialized in this function Indeed, if the first jump to the send_fragmentable label is made, and the address family is not handled in the switch() statement, ret will be used uninitialized. Fix this by initializing err to zero before the jump, like is already done for the jump to the done label. Fixes: 5a924b8951f835b5 ("rxrpc: Don't store the rxrpc header in the Tx queue sk_buffs") Signed-off-by: Geert Uytterhoeven --- While this is not a real false-positive, I believe it cannot cause harm in practice, as AF_RXRPC cannot be used with other transport families than IPv4 and IPv6. --- net/rxrpc/output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c index 004c762c2e8d063c..1473d774d67100c5 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c @@ -403,8 +403,10 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, struct sk_buff *skb, /* send the packet with the don't fragment bit set if we currently * think it's small enough */ - if (iov[1].iov_len >= call->peer->maxdata) + if (iov[1].iov_len >= call->peer->maxdata) { + ret = 0; goto send_fragmentable; + } down_read(&conn->params.local->defrag_sem);