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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 4EC00C33CAF for ; Thu, 16 Jan 2020 18:49:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16FB42072E for ; Thu, 16 Jan 2020 18:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579200570; bh=LhOSRmKm4uP3chQZOSrM41PFKG+C1PjndW0AUBoxZMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0WJqvuJqX3pr4+hKCjPbvaSPGfAvNu+gMDFWPpjLNbAPi5h0yXoXqCof1PQbSJjyw P2gUSNlL2YKXY89fOnE6MQrQ35b2rzmy+Pg1X0XXrkIFzhxOLXjbQl4Nk4DnVWbJIE wlMrdV94CAS8hPgLegstn8sYTsIaq0gt7J3wrI7s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729351AbgAPRJ0 (ORCPT ); Thu, 16 Jan 2020 12:09:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:45306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389371AbgAPRJ0 (ORCPT ); Thu, 16 Jan 2020 12:09:26 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1A00C24694; Thu, 16 Jan 2020 17:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579194565; bh=LhOSRmKm4uP3chQZOSrM41PFKG+C1PjndW0AUBoxZMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SlynQfjRVAp3SOGNm6A9xuZT63nyISnldytOC/R3yQF8woy2GWeHHAT256CFaHLGv 8crI3xLcY8eJnc8+1umZ4IiCGRWaNoMbjlooROiOPvmCqaoK+yJwidQyYJNHxprDRR rYRs8MbaUzVs9yxTm7cwkW/oiNu6kAHBY3fIevss= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Howells , Geert Uytterhoeven , "David S . Miller" , Sasha Levin , linux-afs@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 444/671] rxrpc: Fix uninitialized error code in rxrpc_send_data_packet() Date: Thu, 16 Jan 2020 12:01:22 -0500 Message-Id: <20200116170509.12787-181-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200116170509.12787-1-sashal@kernel.org> References: <20200116170509.12787-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore 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 345dc1c5fe72..31e47cfb3e68 100644 --- a/net/rxrpc/output.c +++ b/net/rxrpc/output.c @@ -524,6 +524,9 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, struct sk_buff *skb, } break; #endif + + default: + BUG(); } if (ret < 0) -- 2.20.1