From patchwork Wed Mar 30 12:02:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaomeng Tong X-Patchwork-Id: 12795729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CCE55C433EF for ; Wed, 30 Mar 2022 12:03:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA35D10E9BC; Wed, 30 Mar 2022 12:03:18 +0000 (UTC) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by gabe.freedesktop.org (Postfix) with ESMTPS id D23E310E9BC for ; Wed, 30 Mar 2022 12:03:16 +0000 (UTC) Received: by mail-pf1-x432.google.com with SMTP id p8so18506746pfh.8 for ; Wed, 30 Mar 2022 05:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=v0/H3G2XFiR4LVmAPedHiWgw4TnVBjO8kBG30Rx6UL8=; b=mL8TYadv8FwnRuRKoTITRg23I+zj3YpjUkS/HxsO1mXhazrpiNa/gQ9ZhqpLDQUrqI Y4H2jEfLUG4ejF2Bhyey9dkFvUs/W7aQIxqRp7nhurrbYn5LEk8qic5kstmJh4wXg7BW Vdk2mKx1nPOwuwOvdqhVdNM5wUN1AsyMVOeIItxhTubGPYT2Q8biMXZkuzyQGVRcL8TD vLAWHCkbUHL5ygmf5oFmiadYdSKWECmwoPmeze/QJEwdiUr0+MG7BhrV7gvPojJCLQft q9izu8XueDRFAoQOtCX/qStvq7xqphJMDjzgUjUwfkywmVU/2xgyEbSfGahUW3czat4F z9Yg== 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:in-reply-to :references; bh=v0/H3G2XFiR4LVmAPedHiWgw4TnVBjO8kBG30Rx6UL8=; b=yUCxb4vSB5SQyo5vAUVmpyIRmBC7c+/J+VclyBs9eNPNVLcB+T6hsDmsPDw5QCwMh9 nUyOrCHIY3hJeg+m3Ws0IJ7rglpQwEuGzq4HgvrK0Q+S/3o72u3xiSwfKA5J9RQLYLAG rr8drZw3QKcCTA3TP+FUybdv6vyy6ImaZaUbm6s9jdxYmQWBRU28CuqZ/HykSAHowHF3 PcoHybjR4Sp5p73M7FYbIDs9mSHDcJ0+q01SvyteWrdAoeorwXQwYAhi45rW5VyRGEtf Sxyq7pJUwGPosDAOkPoM+4oJV2jVOIZcfHZ/pJQlwxEJrethx3s3ZQce2HOTQNa5pBtj MQGQ== X-Gm-Message-State: AOAM530hdrw01aRMwve6bpdWBLmY7sTnmRqw1Qn2/+hWevwoihkh1cgy Ly0OLO9WmV78YvxiBpibCOU= X-Google-Smtp-Source: ABdhPJyR8BQ3qxaZE8/z/Z4rWYLqKvWludsfxnyPd4gxVs9v0cM5heIjKQAvYMUgNX8NERHX+rcSSw== X-Received: by 2002:a05:6a00:194e:b0:4fb:32b9:dfd2 with SMTP id s14-20020a056a00194e00b004fb32b9dfd2mr19805610pfk.10.1648641796180; Wed, 30 Mar 2022 05:03:16 -0700 (PDT) Received: from localhost ([119.3.119.18]) by smtp.gmail.com with ESMTPSA id j9-20020a056a00130900b004f73df40914sm23142978pfu.82.2022.03.30.05.03.14 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Mar 2022 05:03:15 -0700 (PDT) From: Xiaomeng Tong To: patrik.r.jakobsson@gmail.com, airlied@linux.ie, daniel@ffwll.ch Subject: [PATCH 1/5] gma500: fix a missing break in oaktrail_crtc_mode_set Date: Wed, 30 Mar 2022 20:02:42 +0800 Message-Id: <20220330120246.25580-2-xiam0nd.tong@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220330120246.25580-1-xiam0nd.tong@gmail.com> References: <20220330120246.25580-1-xiam0nd.tong@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, yakui.zhao@intel.com, Xiaomeng Tong , airlied@redhat.com, rob@ti.com, alan@linux.intel.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of exiting the loop as expected when an entry is found, the list_for_each_entry() continues until the traversal is complete. It will certainly lead to a invalid reference to list itereator variable 'connector' after the loop pointing an bogus address at an offset from the list head, and could lead to multiple 'is_*' flags being set with true mistakely too. The invalid reference to list itereator is here: drm_object_property_get_value(&connector->base, To fix this, when found the entry, add a break after the switch statement. Fixes: a69ac9ea85d87 ("drm/gma500: drm_connector_property -> drm_object_property") Signed-off-by: Xiaomeng Tong --- drivers/gpu/drm/gma500/oaktrail_crtc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/oaktrail_crtc.c b/drivers/gpu/drm/gma500/oaktrail_crtc.c index 36c7c2686c90..eb2d79872bd5 100644 --- a/drivers/gpu/drm/gma500/oaktrail_crtc.c +++ b/drivers/gpu/drm/gma500/oaktrail_crtc.c @@ -409,6 +409,8 @@ static int oaktrail_crtc_mode_set(struct drm_crtc *crtc, is_mipi = true; break; } + + break; } /* Disable the VGA plane that we never use */ From patchwork Wed Mar 30 12:02:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaomeng Tong X-Patchwork-Id: 12795730 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFCCFC433F5 for ; Wed, 30 Mar 2022 12:03:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E5E5410EA79; Wed, 30 Mar 2022 12:03:23 +0000 (UTC) Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by gabe.freedesktop.org (Postfix) with ESMTPS id A7F8410EA79 for ; Wed, 30 Mar 2022 12:03:22 +0000 (UTC) Received: by mail-pl1-x633.google.com with SMTP id w8so20258891pll.10 for ; Wed, 30 Mar 2022 05:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AvqwHy5iP7QDYL90jHvlfS06VpNkgs2PdfjMbWdFXfE=; b=CUSnOCzxqgVRMtGhfZ4Fy+WyRU2GGqdh5D/k3XFkbJDJPj/P66POAZKY4dNjn2XQkf FSlZOHnmvEeO1rwpxooAaYyRSdT+Xdb2zuHBGjfhISLnyARzPggG/rs5cxIlTaxzOzki A8HjFhdN0mp0ByA1LrCj6pRVd8XmdIfw4qCmhwju5c9OCFwblO4rU4c2bYCPUhdSrgG3 iSMgDyu2u2O0bI1bCgtlaeVvd3mT/iQaNvyn3xfH+kFktz4VewiRslZ/lxD2rTIPLgC6 Fd5DsWOQ6etUz2D6YMpdVyiFPCQIMMduoPTX4tB+mAfH+d5Fa+b+PWAfkmhiWoZBVn1U pgog== 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:in-reply-to :references; bh=AvqwHy5iP7QDYL90jHvlfS06VpNkgs2PdfjMbWdFXfE=; b=EN/Ijp0n2RVd+nrIXdxPmTgSxX/mO/5/H8bG/zr9PK53jUpBRM36U8Qb5QgQ9KnIyl sM566MuCKEr6FRk9RsXucg5TRFgge7+YAvAHdCzaykqaPyHkhMIqeP5nz9PKc4LZmJJI gIG6XY3WFdOpDjESaz03GtVISFESNncpEY3guBKrKreb0bQBq1U7iw3n3ZO8jEJc9sdU GqrbIj7KA+w+6Asj8Sf6XFhMcQZuUxNUHgomeqPsyXVzeroKtoac3PdisceKo9NOl0Y0 uLCmuGrf+YiDZh3bwLwFjYoRfklBHtm7jUQt3eVY0x04HrlFOgf3BaxXstUH+n116uOU CfVw== X-Gm-Message-State: AOAM533ZOVeiSC3cL/Jy0ZjzefzhBpeark6KS1kKnsR/FI7lNM6zw/Oj bmeN3zMIQcawzun9/4rduOH1XfMjI8dPvA== X-Google-Smtp-Source: ABdhPJy0jqMqa9ZIkbR+7qbrpJnbD0474GqIHiQoKDnZ/tH3sXBv6IRUdF4/oiU/ag6EBaHguPWVSQ== X-Received: by 2002:a17:903:41cf:b0:154:25bf:7d0f with SMTP id u15-20020a17090341cf00b0015425bf7d0fmr34409382ple.41.1648641802229; Wed, 30 Mar 2022 05:03:22 -0700 (PDT) Received: from localhost ([119.3.119.18]) by smtp.gmail.com with ESMTPSA id q13-20020aa7982d000000b004fb199b9c7dsm19622304pfl.119.2022.03.30.05.03.20 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Mar 2022 05:03:21 -0700 (PDT) From: Xiaomeng Tong To: patrik.r.jakobsson@gmail.com, airlied@linux.ie, daniel@ffwll.ch Subject: [PATCH 2/5] gma500: fix a missing break in cdv_intel_crtc_mode_set Date: Wed, 30 Mar 2022 20:02:43 +0800 Message-Id: <20220330120246.25580-3-xiam0nd.tong@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220330120246.25580-1-xiam0nd.tong@gmail.com> References: <20220330120246.25580-1-xiam0nd.tong@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, yakui.zhao@intel.com, Xiaomeng Tong , airlied@redhat.com, rob@ti.com, alan@linux.intel.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of exiting the loop as expected when an entry is found, the list_for_each_entry() continues until the traversal is complete. It could lead to a invalid reference to 'ddi_select' after the loop, and could lead to multiple 'is_*' flags being set with true mistakely, too. The invalid reference to 'ddi_select' is here: cdv_dpll_set_clock_cdv(dev, crtc, &clock, is_lvds, ddi_select); To fix this, when found the entry, add a break after the switch statement. Fixes: d66760962d75 ("gma500: Program the DPLL lane based on the selected digitial port") Signed-off-by: Xiaomeng Tong --- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c index 94ebc48a4349..3e93019b17cb 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_display.c +++ b/drivers/gpu/drm/gma500/cdv_intel_display.c @@ -616,6 +616,8 @@ static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc, DRM_ERROR("invalid output type.\n"); return 0; } + + break; } if (dev_priv->dplla_96mhz) From patchwork Wed Mar 30 12:02:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaomeng Tong X-Patchwork-Id: 12795731 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3B410C433EF for ; Wed, 30 Mar 2022 12:03:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C7CB10EA9E; Wed, 30 Mar 2022 12:03:30 +0000 (UTC) Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by gabe.freedesktop.org (Postfix) with ESMTPS id BEBC710EA9E for ; Wed, 30 Mar 2022 12:03:27 +0000 (UTC) Received: by mail-pf1-x42a.google.com with SMTP id u22so18505395pfg.6 for ; Wed, 30 Mar 2022 05:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4gcVpR2FizLJu6RR3F0oPHrwVu4t3M1EAjmgqnVTUXw=; b=jcHoloxMP+C79gc6dBvnkAdVCQRfO2uj4O8uKZkKARqsKyg1ZbGoC4b5O7l/sOAXJA SFHqCodMGi0ble3CbmlXAfQoy3mrD5wWpVxrpAsTgCbnT2ZFXZaor39CwUro9hliLND3 pbMsCcEUJIyyQBYVfjXH8Byyfxr5avmvBM/BR+05VfzdWvnVNQglk2vLunPD1Mr+ApCA A5iE9zkrlIYRBUdxE7dirJZDht6JYnL+0rdCPLp1f54HsYXZONrHyPGYPYJtQAgXFpYn h9GogzzMAk0ipItJFIlRnVwrVFHPNEkOvuCLxahKny1fqMnjinQwrYd1P5rWYMc7IAYF 4tRQ== 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:in-reply-to :references; bh=4gcVpR2FizLJu6RR3F0oPHrwVu4t3M1EAjmgqnVTUXw=; b=gJI8ARmgBqtBSwa2AYhEZoyQDTPcWIdKAlCMs+x27LZonYWcHdhb0og+67ARdnypvy CpDTJpObimWf3uzEsKWyhmzqWMXQRtSZ0/v37AXvpl0C6tVBtRlnqp2x+oRKbrgSNe3Z JOvj4i39Bzn++SGy4ksTuI8Ar6c7rzveZwXQcRljYHR8aaVkNpJUSE3XoDyibgIHBJKH vfDfbZqJc/3eLIi1h3mp3GAxVxKszyasDvX2W+9maMSMwx6GE76PaT+cT3X9PNNFQ8Z3 1G65YvbcYCnClm/HLpVc9t+PV8G7khrd3ABby75+YVb/D/06AZ/nmhrpQYegN5i/NaQj WC7g== X-Gm-Message-State: AOAM530yZJ7Kvi7ORnT8JPd4bOewHEUtlkG4GcKqFfRbshEsEipqqQGP G7u3R6sQJbSLN4j4H0Pi7l0= X-Google-Smtp-Source: ABdhPJzL0rbJ0K2I89qnqiuRPMDNCIkKbUY7vwxf1xIQFLHClFI3u9l3Ln29b5g4dAdJ/hFhzAoqEw== X-Received: by 2002:a05:6a00:114b:b0:4f7:915:3ec3 with SMTP id b11-20020a056a00114b00b004f709153ec3mr33199193pfm.8.1648641807349; Wed, 30 Mar 2022 05:03:27 -0700 (PDT) Received: from localhost ([119.3.119.18]) by smtp.gmail.com with ESMTPSA id c21-20020a637255000000b003822e80f132sm18965408pgn.12.2022.03.30.05.03.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Mar 2022 05:03:26 -0700 (PDT) From: Xiaomeng Tong To: patrik.r.jakobsson@gmail.com, airlied@linux.ie, daniel@ffwll.ch Subject: [PATCH 3/5] gma500: fix a missing break in psb_intel_crtc_mode_set Date: Wed, 30 Mar 2022 20:02:44 +0800 Message-Id: <20220330120246.25580-4-xiam0nd.tong@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220330120246.25580-1-xiam0nd.tong@gmail.com> References: <20220330120246.25580-1-xiam0nd.tong@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, yakui.zhao@intel.com, Xiaomeng Tong , airlied@redhat.com, rob@ti.com, alan@linux.intel.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of exiting the loop as expected when an entry is found, the list_for_each_entry() continues until the traversal is complete. It could result in multiple 'is_*' flags being set with true mistakely. To fix this, when found the entry, add a break after the switch statement. Fixes: 89c78134cc54d (" gma500: Add Poulsbo support") Signed-off-by: Xiaomeng Tong --- drivers/gpu/drm/gma500/psb_intel_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c index 42d1a733e124..85fc61bf333a 100644 --- a/drivers/gpu/drm/gma500/psb_intel_display.c +++ b/drivers/gpu/drm/gma500/psb_intel_display.c @@ -134,6 +134,8 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc, is_tv = true; break; } + + break; } refclk = 96000; From patchwork Wed Mar 30 12:02:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaomeng Tong X-Patchwork-Id: 12795732 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ADA5CC433F5 for ; Wed, 30 Mar 2022 12:03:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B530110EAC1; Wed, 30 Mar 2022 12:03:35 +0000 (UTC) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by gabe.freedesktop.org (Postfix) with ESMTPS id 10E2410EAC1 for ; Wed, 30 Mar 2022 12:03:32 +0000 (UTC) Received: by mail-pf1-x432.google.com with SMTP id u22so18505577pfg.6 for ; Wed, 30 Mar 2022 05:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Mw0Xb3acT/jJngaoGEDh96qavNQRf5DbODEg2Ia3G20=; b=j6tRbHGh4PwL7QVNwVCLvVVrcrP+486cq3+/B0xQQu2bAJsOtuKDqRaidYYvWi8QiJ 9EBrPA+wjyOnufhmgXp/tCoEIh6VuWtCqEFwoSgY1CBncvyGFo9i+MZjB3+4aGb0rGGO g/6gkLtPfHVx/nmbA1pOqMUqcXQ/XnRC6opt0Y6pe3t+W/SBvFPGxGPWP1xXk1kcUjJm cRGYrS8ElkYE0UHThjswLXBZLSQQhtflN0tCC5ZbPDWpKOgvbfieOitc+xecRpvTo9QK 8RRWp9rlO2FSN+AoX9nuBUIwGA+flgagxlgF12DgERG2eEJtR/zbLyUS2hZ1ei1CPreK SuVA== 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:in-reply-to :references; bh=Mw0Xb3acT/jJngaoGEDh96qavNQRf5DbODEg2Ia3G20=; b=VzuIptx8yPYHgjA3wacvDsF3PJkrJTORMZhLnk9nSoQp+BgDKT/2F9OozYcWvrh/uY paqOUdI8YhN7rGzoiBrt2oTma2ZIWmB05bseV4Dr57zxI/55VI71F2a1eMJwtqteCRAQ 9jdOTYg4OKJ+aPWU8JBrnS/N8AzNMZZSAyIQn6b4gz6HRJQ7X1dwBFGuTM1fZQUSqguZ S3ncag8kGXvJc7anvThn8phTZXw04Twt5smvWQ+TwfoLOkwdBX+zDtueRUD7G5hYcIQT PtKrzzqZ8x42EZ4zZomPiLkY5DJLLnepmCjrFWAymSt8IcdYYrbo98OqJUPIgZufiWd7 4Qdg== X-Gm-Message-State: AOAM5305PzHhnNzUN1PFpCQr5K3qKI4+0z/vLMrP9mZbJZTcOXbImyNf iBdUeVYjl42P789vqbAI/xw= X-Google-Smtp-Source: ABdhPJwEBM261hXljDs2qeFIV354BPd5l2EbtG6IRonEl0apDdH4VGgubhpJfsdQJ9mYtScoLWW0BA== X-Received: by 2002:aa7:8211:0:b0:4f7:8b7:239b with SMTP id k17-20020aa78211000000b004f708b7239bmr32372071pfi.64.1648641811381; Wed, 30 Mar 2022 05:03:31 -0700 (PDT) Received: from localhost ([119.3.119.18]) by smtp.gmail.com with ESMTPSA id oo17-20020a17090b1c9100b001bf0ccc59c2sm6446120pjb.16.2022.03.30.05.03.30 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Mar 2022 05:03:30 -0700 (PDT) From: Xiaomeng Tong To: patrik.r.jakobsson@gmail.com, airlied@linux.ie, daniel@ffwll.ch Subject: [PATCH 4/5] gma500: fix a missing break in cdv_intel_dp_set_m_n Date: Wed, 30 Mar 2022 20:02:45 +0800 Message-Id: <20220330120246.25580-5-xiam0nd.tong@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220330120246.25580-1-xiam0nd.tong@gmail.com> References: <20220330120246.25580-1-xiam0nd.tong@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, yakui.zhao@intel.com, Xiaomeng Tong , airlied@redhat.com, rob@ti.com, alan@linux.intel.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of exiting the loop as expected when an entry is found, the list_for_each_entry() continues until the traversal is complete. It could lead to a invalid reference to 'lane_count/bpp' after the loop. The invalid reference to 'lane_count/bpp' is here: cdv_intel_dp_compute_m_n(bpp, lane_count, To fix this, when found the entry, add a break after the switch statement. Fixes: 8695b61294356 ("gma500: Add the support of display port on CDV") Signed-off-by: Xiaomeng Tong --- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c index ba6ad1466374..e6473b8da296 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c @@ -1016,6 +1016,8 @@ cdv_intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, bpp = dev_priv->edp.bpp; break; } + + break; } /* From patchwork Wed Mar 30 12:02:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiaomeng Tong X-Patchwork-Id: 12795733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0F06C433FE for ; Wed, 30 Mar 2022 12:03:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE61210EB1A; Wed, 30 Mar 2022 12:03:42 +0000 (UTC) Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by gabe.freedesktop.org (Postfix) with ESMTPS id 45BBB10EB1A for ; Wed, 30 Mar 2022 12:03:36 +0000 (UTC) Received: by mail-pl1-x636.google.com with SMTP id p17so20261005plo.9 for ; Wed, 30 Mar 2022 05:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=48w9cCcHfu4RFzRm5PZAyw72DdxLC63ffgBHswIn+j4=; b=e2oys9YHS1G4ibMgjW99OE3iDzMIYL6l9CnklayAdF2/xl9anpeDhLfh2+ycju7pkk jVM8SwJI7cy6FAd+qP9m9lafilhptX+dnPyU/ogkIn2Q+w2gPG+PM96hKg+sDnGLgYHS Mh9UTHx7rAA4iTqN0e6oweEDLKGUJ/IsGLmkxDHTid4PHkzEGi/JNsV7282VfYeWex1Q KcaAlOY/6cD1PVyEXlXiSTqh7No95xKZuDfxGaP2Xl7IkShsybZwVKftzdBqrRjzwt9U /hD2+lGydFDG7xj1RAV5R1VQahPryrV4INhY8Ps9tS/2P6o9rtSl0P7xJ79plT1OjGxj m8dg== 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:in-reply-to :references; bh=48w9cCcHfu4RFzRm5PZAyw72DdxLC63ffgBHswIn+j4=; b=1YCYgMkJvVOWc7bKF16Eh3niEPqnKu/gasv09Crm60VX/nW4I1UC8jBYonoesIk50Y OZwlG9Z8ZkcDwb0KU6nNHWjq+8gLxfNHPk8jWmZNgPL6anFmvQdgD0aTQqN6Rw9b0lHP WqU3Ju0UvBlPPMcAlfUTuIn5cLlJcKowQCCKC4aHZ9QR/c/u/YQfG9w7XfJi9cLGnlbO Oxy9cjwqupVRWnFvASUro9/nWkEz0F2dwtbnvPMRxGlp6ScexnMPkQFUiB8YFmRRzOsS Pa7VLaXFJilF8ftwKqgOpVXRpaYZ1+J0WjYkTI3A2WQbGA9f6AOyDpPpeSEVYxlCkYXI tUpA== X-Gm-Message-State: AOAM53044ymPA+Sm95mD1LcOSSKYwJEISyfuRHs9SYe/NAL7caYafyfe NjaIxQUkUFJqaEnrtVsu2tc= X-Google-Smtp-Source: ABdhPJwbqJd5wNulvaZLttMt50ldtMVPaMlLpVaNrun46JlZVZd5PnTlSq49PePx/8vUsZI1mYU89A== X-Received: by 2002:a17:90b:1c07:b0:1c7:5324:c68e with SMTP id oc7-20020a17090b1c0700b001c75324c68emr4691633pjb.202.1648641815737; Wed, 30 Mar 2022 05:03:35 -0700 (PDT) Received: from localhost ([119.3.119.18]) by smtp.gmail.com with ESMTPSA id m18-20020a056a00081200b004faeae3a291sm22940884pfk.26.2022.03.30.05.03.34 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Mar 2022 05:03:35 -0700 (PDT) From: Xiaomeng Tong To: patrik.r.jakobsson@gmail.com, airlied@linux.ie, daniel@ffwll.ch Subject: [PATCH 5/5] gma500: fix a missing break in psb_driver_load Date: Wed, 30 Mar 2022 20:02:46 +0800 Message-Id: <20220330120246.25580-6-xiam0nd.tong@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220330120246.25580-1-xiam0nd.tong@gmail.com> References: <20220330120246.25580-1-xiam0nd.tong@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, yakui.zhao@intel.com, Xiaomeng Tong , airlied@redhat.com, rob@ti.com, alan@linux.intel.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of exiting the loop as expected when an entry is found, the list_for_each_entry() continues until the traversal is complete. To avoid potential executing 'ret = gma_backlight_init(dev);' repeatly, add a break after the switch statement. Fixes: 5c49fd3aa0ab0 ("gma500: Add the core DRM files and headers") Signed-off-by: Xiaomeng Tong --- drivers/gpu/drm/gma500/psb_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 65cf1c79dd7c..d65a68811bf7 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -398,6 +398,8 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags) ret = gma_backlight_init(dev); break; } + + break; } if (ret)