From patchwork Thu Jun 15 14:39:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 693004 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp562186wru; Thu, 15 Jun 2023 07:39:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ76vh0SXg8wulvZwKl5bjc/8QRUyaHvosuxDkMQnP6BO2OxGHZ4VF83KXTj20ygCpnRCg1B X-Received: by 2002:a05:6a00:2da3:b0:666:7866:ece9 with SMTP id fb35-20020a056a002da300b006667866ece9mr4645456pfb.33.1686839995901; Thu, 15 Jun 2023 07:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686839995; cv=none; d=google.com; s=arc-20160816; b=yUrJ0zCvouh14sk5FLpkEerGWlrYA9Dr9bMqmqkr26kc914SKQcRKy8ntxt1JOaC1x KVpV9OFY2sCn7jqALI6mC0cZGgyLlqDE9yju/IDzGoPqNeHTAeR0+jl1Ocr1apTpD2HH 9oxF5ZYY2twBI1KbUNAu7oMp5F20iFxZo0384fJ/8cGGP2sXdsuShMTLajmCtSyy2hKS S6sazoYiZwA8XoVKzWQ6WToNQLH4h94ZvOU8nbHqr7QmTfw1f9tXF4KSp5cSrP1uxHg+ p54ctL16AbpnYemGIjPLBBqaEcfllb4HWXmfIBqIUmUq3N82ehWcY8dgzqGiPSIgzj9t DBFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=PJ474ru3Csrr9GZeo5jFdK0acukrlhlJy+sdzWVQnpM=; b=inzwhGP8x7twqNHYtGhUqHMFk6dT2jmSEU3/5OvjBdFnpy9qECm5ZSmuFcb8pMFmBJ D+jplhdVXqRGaor5pJWNFC+ZLM60kBOtb8sRke+vJ2FR75WjWoK/xF4kqts51N1b87zw juCx7m/o8lY1P3OR4bhr9t55K6H/MK3H76bQmIhrhYUDJwXOa2ZLWCJaQ9x15SXcU7yi EC8CTuoh9QTViVZ6Vp7N/9ShSmy7JEp6dkBcp2AgyGBk5L+e6g9ENtlxzOkKELJvo3nm xZCRp/i4ydfCSTZc4Ee/IeVyMsCLOqpCBeJ7Qp6EE0UEzQen9DoQiNae2j/U3AlnA+K6 jtPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zp+D5C1K; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id w4-20020a656944000000b005428f25f67asi10004593pgq.618.2023.06.15.07.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 07:39:55 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zp+D5C1K; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2E12786335; Thu, 15 Jun 2023 16:39:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="zp+D5C1K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6DCDA86322; Thu, 15 Jun 2023 16:39:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 01ED98475C for ; Thu, 15 Jun 2023 16:39:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f849a0e371so113544e87.1 for ; Thu, 15 Jun 2023 07:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686839984; x=1689431984; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=PJ474ru3Csrr9GZeo5jFdK0acukrlhlJy+sdzWVQnpM=; b=zp+D5C1K+62ONeNKgAs3ZoFD0lCV2q5dO8ftDS5KCd6hbS46/PMV3abI38xKBjunEA trAATAngzZdkv7d+5JgygwuNrm+4XYgajGSlK+G5OkPQpaDk3IiNIU41jUoJnMO4t4Mg splK2yuyI/Z+vQuFSKoM5UlN1Ivjv0+2aCGaMr4xW2QsfVv2BOyBCBQL/+C8N5JCKWu5 acW4/PraEq+XyAYeKpgLdtZPpHkoditYQ9p1Bq4JS4sns7vJzDYbIZ7YEhVbc+A4wqU3 OtHSyVdRnH3ZHq43wu4OVvyppCABfycJn14I0h6rLwOxMqahAcJr8ZBWpFJSCX88Ns/o JFzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686839984; x=1689431984; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PJ474ru3Csrr9GZeo5jFdK0acukrlhlJy+sdzWVQnpM=; b=lj+y18u5w6GoG9O0W2fSpIOWvoWrUdM/mz5B8IMGmdQtmjAkxtxT0rzdd/bjItDUQw SAqWKwehU1uZo6RFZMfj8UFCv+4pj78Z20DT3OrEIoi+HqIv46AkvauXvz1LO2gZplNx nn2QgLlpVhy4neXMzRYJvor1XM8w8BFd6ZbmAtFAdq3O1LTxvu9BTxYlnO6EmnByK6NU Qe84BL4AXqqgb9P4LMVjxM7v7jfFWlEf9ItGwCKP5R81iGPpJ+Xr2uTCqznrWtDtCBtV k8GrfWOfoUJPr8h6V837WOWwGaOkkZ9YYKl8oTAuSSOgihvKAJPguZh/ccSdKV12h5zn pwVw== X-Gm-Message-State: AC+VfDxXfZ9oOuQOecXVVhGRsY/kuQ1Hp2UE8evoxJuwjK+opK8l7+Zc uk9GFiS4adxm256PETVvBdhNvznwIoPTmMw8ePVSTg== X-Received: by 2002:ac2:5b89:0:b0:4f6:2477:ed42 with SMTP id o9-20020ac25b89000000b004f62477ed42mr10557853lfn.26.1686839984203; Thu, 15 Jun 2023 07:39:44 -0700 (PDT) Received: from localhost.localdomain (ppp089210114029.access.hol.gr. [89.210.114.29]) by smtp.gmail.com with ESMTPSA id w11-20020a1cf60b000000b003f7ff6b1201sm20601273wmc.29.2023.06.15.07.39.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 07:39:43 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt Subject: [PATCH 1/5] efi_loader: check the status of disconnected drivers Date: Thu, 15 Jun 2023 17:39:37 +0300 Message-Id: <20230615143941.416924-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean efi_uninstall_protocol() calls efi_disconnect_all_drivers() but never checks the return value. Honor that and return an appropriate error if the associated controllers failed to disconnect Signed-off-by: Ilias Apalodimas --- lib/efi_loader/efi_boottime.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 5006c0e1e4af..68198e6b5ff6 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1353,7 +1353,11 @@ static efi_status_t efi_uninstall_protocol if (r != EFI_SUCCESS) goto out; /* Disconnect controllers */ - efi_disconnect_all_drivers(efiobj, protocol, NULL); + r = efi_disconnect_all_drivers(efiobj, protocol, NULL); + if (r != EFI_SUCCESS) { + r = EFI_DEVICE_ERROR; + goto out; + } /* Close protocol */ list_for_each_entry_safe(item, pos, &handler->open_infos, link) { if (item->info.attributes ==