From patchwork Sat Jan 15 04:14:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 1580326 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=etubUabk; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JbPvy0tcqz9sP7 for ; Sat, 15 Jan 2022 15:15:08 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1n8aT1-00077f-Qr; Sat, 15 Jan 2022 04:15:03 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1n8aT0-00077X-Jy for fwts-devel@lists.ubuntu.com; Sat, 15 Jan 2022 04:15:02 +0000 Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 629553F164 for ; Sat, 15 Jan 2022 04:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1642220102; bh=jahLqUo6s2KPBqebOhXtzlGKwXsv8n+paCtqsVkVqU0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=etubUabkWfF+ypBmJHZ3Mucid1rqSme5hjmpqJQ2Z0JwF7bDpP+Z/G8gtMlzZ17d1 sjmoVRAveh5LCS6e92Y9pWx40nFnOuBjrTXZ23UVmHijplX4l0cAIgZH2kC2DD/vfI DHZZqu8d3EStO6gHtQUuViOCiFGfnGi3HfWWRTjRpFY3SWHDZt8XP8v+YxXjsv/kUm OE11HwU3MXIGwlm1SVL8pFm4YrG/RWaV3zRE+ndDe2jXWSCEgrnsiYlc3K6ggIEAQL R7E30RITyW0D8D3niwd+okFeoGyNBd+QIKEG7bwVbJ7kyLgCUcju1BGkmPHslXXl5j fdFT/vuC6jyGQ== Received: by mail-pg1-f197.google.com with SMTP id b7-20020a639307000000b003428e51f24dso3040832pge.15 for ; Fri, 14 Jan 2022 20:15:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jahLqUo6s2KPBqebOhXtzlGKwXsv8n+paCtqsVkVqU0=; b=N8cJrsiC/5R8N/skZp6lz9Km/eZXMgwGKdpXl45qL65FczP3sZaZ6MImKphTgu18dD dorvVbBRa+8fiHo4UFRo/O6jAWvQC4IgvzH015g4YbzK4K/gKNWjvkJgIRIq8nvVHgzw jqUD8zPUMCYhcb9VcgKvAjlD/fDoeg8PYqGEDeYnQM+H0UfJuE1irYkygA2VPoRGOW6Q 9asSe7NyCmuw6CSxCv774D5RsmynJ8ut/HSvN8GUER/QHSTSO9atlHgDz7A5UV4gjLvn OtWQR6a7T8lrQfSBvFS+CL79h+MkA/Tv6m1g/kk0uo1m8PhOk7yC43c7HSV0hNvpJy4X uRUg== X-Gm-Message-State: AOAM532nBKPVwZXKlvWw/tHMLYblLs9Yfcu36A+SQNdwVYG3rRl6/z+l uhVQ4kRPdkXyrfU+ezhpM+5CICFKBav7Vnlnl2RgH1ftJj86oGfnDbVYTzGGJ99HER/opGyp/U6 +qen7hduC/SbQqLp8N2SPuHEJas3iuI3u+PEEbgFJ X-Received: by 2002:a63:6e86:: with SMTP id j128mr10494984pgc.6.1642220100757; Fri, 14 Jan 2022 20:15:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUdS3bLfigpDSTIuOEMFhA+Ou80VtvXZNkYLHOpKI8YubLuMOgWBV+JHIYjCHqJmRNMER2bw== X-Received: by 2002:a63:6e86:: with SMTP id j128mr10494970pgc.6.1642220100401; Fri, 14 Jan 2022 20:15:00 -0800 (PST) Received: from canonical.com (node-1w7jr9yebujesw96nb80eku0c.ipv6.telus.net. [2001:56a:78ed:fb00:b3ce:3ea2:4639:e2ec]) by smtp.gmail.com with ESMTPSA id lp6sm14978529pjb.55.2022.01.14.20.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 20:14:59 -0800 (PST) From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH] fwts_acpica: skip unneccessary null check Date: Fri, 14 Jan 2022 21:14:58 -0700 Message-Id: <20220115041458.697148-1-alex.hung@canonical.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Buglink: https://bugs.launchpad.net/bugs/1952671 "context" is always passed as NULL so it should not be used or checked. Signed-off-by: Alex Hung Acked-by: Alex Hung Acked-by: Alex Hung Acked-by: Alex Hung --- src/libfwtsacpica/fwts_acpica.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/libfwtsacpica/fwts_acpica.c b/src/libfwtsacpica/fwts_acpica.c index a0ef1c21..50231464 100644 --- a/src/libfwtsacpica/fwts_acpica.c +++ b/src/libfwtsacpica/fwts_acpica.c @@ -313,9 +313,6 @@ static ACPI_STATUS fwts_region_handler( case AML_FIELD_ATTRIB_BYTES: case AML_FIELD_ATTRIB_RAW_BYTES: case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES: - if (!context) - return AE_BAD_PARAMETER; - length = context->AccessLength - 2; break; default: break; @@ -340,9 +337,6 @@ static ACPI_STATUS fwts_region_handler( case AML_FIELD_ATTRIB_BYTES: case AML_FIELD_ATTRIB_RAW_BYTES: case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES: - if (!context) - return AE_BAD_PARAMETER; - length = context->AccessLength - 2; break; default: break;