From patchwork Fri Jul 20 01:47:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 142401 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2392119ljj; Thu, 19 Jul 2018 18:48:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcU3YBBqZRO5k46A6gz6NPjjvf58xkKI29QRODavqQ/8sTCb/68k5PjEZB//w1LLCMRmAC2 X-Received: by 2002:a63:f:: with SMTP id 15-v6mr98331pga.430.1532051284544; Thu, 19 Jul 2018 18:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532051284; cv=none; d=google.com; s=arc-20160816; b=MmKQleWV2pZ2BafK2tGaaUpdKpqE1uMYE5yxQJlaHUsTX4wOATfYby0GuC8Uc2cC/K hEYCMyYacfzXPj7NZaivGvluUiCoHunEyvMto3aCPLusFmkzYhcSOQr1eAVcyVdI3/iZ 3KqQxt3whbh+plmV0RZiPiVvZmo9Jh7qtmCdHKI6bb79xL33r8XUzCn4ymDvkDJJ98ji ZLZsfjPQiO7pnLngAz2qWXZBjX9oy1Oq6pEC2d9YeZxRoctn6oWdbCTxlei2BE92tam/ jJmLZjZgNfrRUIE7C+91Pw84CCyJXTj/H4/0xPTv/K14Id/j+T/BaJORgJd/gUnTEJMH ryxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=qOa+Lf5zVsBgxcSLC3sLa0St+7nZBpqptye8Lhy5gjc=; b=PoQA/NYArFlRR8tjJIYS1fLv6K/OvRPS1a/ovwjLP7E7TiFLZuEzf7Pu/uj01Y3NCA 2Y3pjik87fBpmkbLbTfqgS/Qd608x6WmMlanARCmXQXxgYgjYBQokEk7BF79cpXDAhTn iiztL18WT9uhxlwqaQNuPZD8C1lWZZHols9qvxzVCvYUeVLF2H2dTVTw8TXf3Ne+5Qqn es/7aAxh0UpfnorR5TiauoE5x3Mr6dYsZXGk1CELFZreeGhdoaTnDpwuZ8lEM1eohOTX Cfi3umlKHzTXim5CKX8/w91Lp11XSBOCZ+4c8MXcHZH1YHfqfiH3BrD2SlSMUSCf4qUY 259g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="V/ow4tfM"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23-v6si659247pgb.420.2018.07.19.18.48.04; Thu, 19 Jul 2018 18:48:04 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b="V/ow4tfM"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731336AbeGTCdw (ORCPT + 31 others); Thu, 19 Jul 2018 22:33:52 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:41594 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731283AbeGTCdv (ORCPT ); Thu, 19 Jul 2018 22:33:51 -0400 Received: by mail-pl0-f67.google.com with SMTP id w8-v6so4433415ply.8 for ; Thu, 19 Jul 2018 18:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qOa+Lf5zVsBgxcSLC3sLa0St+7nZBpqptye8Lhy5gjc=; b=V/ow4tfMcm7/tJ4XYhJoEg0EbNiF2+5ac6quOFS6yBhn3RXipv0DpjMCvq8ny98wSN cFAB408AMzo9ZWP0ZOa1wzGbBo0JuLC5paV8SSx3VH0SC8swIBR5MQrwGnf3/U+JANb/ OZ5N2huf84e8PG55MWHAbHWM9PzAWdAR8K/jc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qOa+Lf5zVsBgxcSLC3sLa0St+7nZBpqptye8Lhy5gjc=; b=E4mSESsE+vX1DWZ3AnKqiZDZZAuxk6hTGgxTs8pcFSeeuE68FAoePWflXJtNtWVN3o 0z1TJpeYqPcYByWQGf5qprZd9YOZGi9HxlC7uDay22HfYI/Y5pkCjQ9fSHq8jS634C92 vtbQNs2wBlmmZGdOWxRrwIe6uVaDWzUmXvqEJbvGzCz/JpTGRWgB9TvNIcTCZfaUJCEx 3in+YhLjFsjz/v6dLjo4A3OweScs8qjbJeQv+TG4hCeWqmwDM/0MtZCC+EN3zcj+kx0t qzWkhfd1tRRWI/O+tzaPfbw0H3kwld4Pg0K+xcxMbZVyUYBgKfRjuUNk49uR/lVIqtN8 M8tA== X-Gm-Message-State: AOUpUlGhs7ool4l2Hr0eo/UbHyxINmvyMMBY1mans6DIicgKiKIxwgY/ wVs/UKgem1tcsq54oXhHQvisAg== X-Received: by 2002:a17:902:4a0c:: with SMTP id w12-v6mr71797pld.289.1532051279783; Thu, 19 Jul 2018 18:47:59 -0700 (PDT) Received: from localhost.localdomain (fs76eedbeb.tkyc508.ap.nuro.jp. [118.238.219.235]) by smtp.gmail.com with ESMTPSA id 203-v6sm475868pgb.14.2018.07.19.18.47.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 18:47:59 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Andy Shevchenko , Hans de Goede , Lukas Wunner Subject: [PATCH 5/9] efi/x86: add missing NULL initialization in UGA draw protocol discovery Date: Fri, 20 Jul 2018 10:47:22 +0900 Message-Id: <20180720014726.24031-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180720014726.24031-1-ard.biesheuvel@linaro.org> References: <20180720014726.24031-1-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The UGA draw protocol discovery routine looks for a EFI handle that has both the UGA draw protocol and the PCI I/O protocol installed. It checks for the latter by calling handle_protocol() and pass it a PCI I/O protocol pointer variable by reference, but fails to initialize it to NULL, which means the non-NULL check later on in the code could produce false positives, given that the return code of the handle_protocol() call is ignored entirely. So add the missing initialization. Tested-by: Hans de Goede Signed-off-by: Ard Biesheuvel --- arch/x86/boot/compressed/eboot.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index ac8e442db71f..92b573fd239c 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -359,6 +359,7 @@ setup_uga(struct screen_info *si, efi_guid_t *uga_proto, unsigned long size) if (status != EFI_SUCCESS) continue; + pciio = NULL; efi_call_early(handle_protocol, handle, &pciio_proto, &pciio); status = efi_call_proto(efi_uga_draw_protocol, get_mode, uga,