From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2262C2D0DB for ; Fri, 24 Jan 2020 10:01:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A04A206D5 for ; Fri, 24 Jan 2020 10:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579860066; bh=A/WSb3YoZMC+j/wj/BzLNT0u35Mo3Ns/MRf3DCyPS6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KND2F+COyhyaaKf9sJcQlpC4JDlEWAY29H0M7/RshF34FJel6zR7q2RLRm8+WC51Q KWHrbPp3USuJDQSOCTAJa8sdSEUcPtjigAjjsfvjCC0psexV9BY8CGplmjAwUVGISU CVqQ4gW4f113KawxyYgd+Y8KIlvsDAMM7H861IVA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730633AbgAXKBF (ORCPT ); Fri, 24 Jan 2020 05:01:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:36454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731304AbgAXKBF (ORCPT ); Fri, 24 Jan 2020 05:01:05 -0500 Received: from localhost (unknown [145.15.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2BE4720709; Fri, 24 Jan 2020 10:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579860064; bh=A/WSb3YoZMC+j/wj/BzLNT0u35Mo3Ns/MRf3DCyPS6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HMB8tw8a1HGzfbbgToXdNOAqcixLVWJJhEZsLZ0gBXXb49RA6BCQmC2qTinwpAQYk K5hfOrha9cXOj6d/2Yp8pyK/AaV2TtUUyYumM8XNJq8K5CFfSJuAfQiAVOZ6rJP25a ZnqiYRW4THWP1oCnsFXztYnrZY15kH9eUTmL7irU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , David Howells , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 250/343] rxrpc: Fix uninitialized error code in rxrpc_send_data_packet() Date: Fri, 24 Jan 2020 10:31:08 +0100 Message-Id: <20200124092952.951854279@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124092919.490687572@linuxfoundation.org> References: <20200124092919.490687572@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Howells [ Upstream commit 3427beb6375d04e9627c67343872e79341a684ea ] 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 BUG()'ing as is done in other places in rxrpc where internal support for future address families will need adding. It should not be possible to reach this normally as the address families are checked up-front. Fixes: 5a924b8951f835b5 ("rxrpc: Don't store the rxrpc header in the Tx queue sk_buffs") Reported-by: Geert Uytterhoeven Signed-off-by: David Howells Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/rxrpc/output.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c index 5b67cb5d47f0e..edddbacf33bc8 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c @@ -404,6 +404,9 @@ send_fragmentable: } break; #endif + + default: + BUG(); } up_write(&conn->params.local->defrag_sem); -- 2.20.1