Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3337787imu; Sun, 11 Nov 2018 12:41:24 -0800 (PST) X-Google-Smtp-Source: AJdET5fEpiXPA+8OjjUSQ9BA/0Ogsr9LQV+oiPTHOuhF8rqLlalVZO13WAFQi0z0ZeeOSDBQIopB X-Received: by 2002:a62:65c3:: with SMTP id z186-v6mr17829967pfb.206.1541968884683; Sun, 11 Nov 2018 12:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968884; cv=none; d=google.com; s=arc-20160816; b=CHkfyuUyYtprFiMXwsNdF0dnjE9shuafSf0oMQGcHOPKSgow1ioW1NFFZPVqYhedFQ NwMDM2aoW6wa67xoyfmLxPU3T201AqVC/janbQnPwHq2j9ilZECaoo3ODQ2Qi89t8KLJ f9t/bOBysnQX3oayh56lGgWXgloTf9eipjBRNn9pfUGnF5+glJHWjdZCNcWRe+TOJEH7 sg1hiM2qher6T5uj86+XrAARWEt7ZGJpNu7VEGN35Y0ycyzbMR9fMcQo06cq/joYYB46 xaALyLScxrPsX3raK6E0gBhDdfeIYvBaFrGXnyrHkeb1hodANfzYRZGODuLpBwVwmyyl PTGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=VuP8OWBaZMs+bL8HlX0tTetqPqzpwH2tlFd5iyxbmBY=; b=TVoCbabxHVO7fFZZNQ2M4TpDi7buA6U6NZZF/CWl69WBLZHB00eoh+/2wRlxEhLTAa yGRSi7V6sxZVoEcWGCtLflh/oZpsND5Wl2YYT0yVBDyjwfakly7sazP3GXLYdASEHGsn fhoYm7h39EfV2HDS5WXlYGXQW0RjXa/WzfYk2Y8C37nymPqyMT65TqWt0WwOG/D57bCP EwXE3aNGxQ9/mQb7f+z7zUO8W69Dv1M2eRlMwv3f99oWe30V7uWW7WFsJI0jBFGd20/L fodQ0YO9Of51VxPfrEFieSe7WP0cyTCvCaX7rTra3SoLzziNf47CpFt52oaC3rXd9DH7 2FUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si9872774pgp.307.2018.11.11.12.41.09; Sun, 11 Nov 2018 12:41:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729905AbeKLFsE (ORCPT + 99 others); Mon, 12 Nov 2018 00:48:04 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49404 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729855AbeKLFsD (ORCPT ); Mon, 12 Nov 2018 00:48:03 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsQ-0000l9-CH; Sun, 11 Nov 2018 19:58:34 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsO-0001Nx-2C; Sun, 11 Nov 2018 19:58:32 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Dan Carpenter" , "Bjorn Helgaas" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 024/366] PCI: ibmphp: Fix use-before-set in get_max_bus_speed() In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter commit 4051f5ebb11c6ef4b0d3eac2fbbd187c070656c5 upstream. The "rc" variable is only initialized on the error path. The caller doesn't check the return but, if "rc" is non-zero, then this function is basically a no-op. Fixes: 3749c51ac6c1 ("PCI: Make current and maximum bus speeds part of the PCI core") Signed-off-by: Dan Carpenter Signed-off-by: Bjorn Helgaas Signed-off-by: Ben Hutchings --- drivers/pci/hotplug/ibmphp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c @@ -397,7 +397,7 @@ static int get_adapter_present(struct ho static int get_max_bus_speed(struct slot *slot) { - int rc; + int rc = 0; u8 mode = 0; enum pci_bus_speed speed; struct pci_bus *bus = slot->hotplug_slot->pci_slot->bus;