From patchwork Mon Aug 6 06:19:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 10556617 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AAD0613B4 for ; Mon, 6 Aug 2018 08:22:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 989D62915E for ; Mon, 6 Aug 2018 08:22:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B8C32922D; Mon, 6 Aug 2018 08:22:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0905E2915E for ; Mon, 6 Aug 2018 08:22:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 777B96E23D; Mon, 6 Aug 2018 08:20:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on070e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::70e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E6D289E1A for ; Mon, 6 Aug 2018 06:19:32 +0000 (UTC) Received: from orc.pedanet (85.226.244.23) by DB6PR0201MB2455.eurprd02.prod.outlook.com (2603:10a6:4:35::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.18; Mon, 6 Aug 2018 06:19:28 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] drm/sti: do not remove the drm_bridge that was never added Date: Mon, 6 Aug 2018 08:19:09 +0200 Message-Id: <20180806061910.29914-2-peda@axentia.se> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180806061910.29914-1-peda@axentia.se> References: <20180806061910.29914-1-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [85.226.244.23] X-ClientProxiedBy: HE1PR05CA0334.eurprd05.prod.outlook.com (2603:10a6:7:92::29) To DB6PR0201MB2455.eurprd02.prod.outlook.com (2603:10a6:4:35::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 24bbea72-9ecf-4345-be0d-08d5fb649132 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021125)(8989117)(5600074)(711020)(4534165)(7022125)(4603075)(4627221)(201702281549075)(8990107)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020); SRVR:DB6PR0201MB2455; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0201MB2455; 3:E1zvlA8xzgh1Vp2n1B/OLp0pMFd/OsZt0/LHbbnaSV7/KRSs4fk0Qs/jxFt0C33SY72TZgH6SSb0BF8R2zpnSaAWCCyiD+3sSWJY4hrsmWxbZfyW4cmiO194ynopRaRkaxlZikfDo6YUBnUBOuLyAj3J3nxJAj+MsI935T2Th3PwekSCbj5eg7KHI2/WbjrBHG+L3oWBrhWOXYtXtQtLOxSAFiseZdvzVQnalKxkbHL80ynjuP1GjIvgrolj4YMj; 25:JjJq28pGOj1dY5muSUDO2mULrW18LYHTMwGRmi5Bm02nKO1K+oap/nV6Gpdt1sJSY0MwPJtXBg3m85hovP7lfHQoY2zw0gRwEJEb8OMuXwe8L+xcYeLNHTKRGDHD6paLOQXmQHrs2JAoLi39tnEUL5gcBimBjhaN2jvl9ETmGb15drvDnZn0X/kKcQTGtUaYUUvXNsI7wt5rFyCt6p3t9Evs6f9WxGZC82SFHLbv2yy+WN+CepGfi2YuzcpWyi02Z1rHg9gU0t+EiVe/N9ZAZf3WZqkFhVyVwoh1k+FDRnK+hPzxzT620dgn2NNOOhmadIt5nRSdRB+XvN8Qp3KHxw==; 31:bhYxh1uCniDuqIS6hCcgFg0L6VC+PLGAT7SUCnosj1VYJJIjknnS2QPCgeD7L8NL6UKxVboq8GxW7rPJhmrPauoJ4+7hngvXb+CIen0XDitfJO8BOwr5MxiOjQVzBu/z9X0vz0koyQ9X+umd4oRdzyiFmaH8DOAAtFijB75CsizCdwn6b4m8ea13r0p95VcBT6JZnRvVh8eU0W0PSGlMqPGN5XmOWIZLRv7xIB1qavc= X-MS-TrafficTypeDiagnostic: DB6PR0201MB2455: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(2016111802025)(20161123560045)(6072148)(6043046)(201708071742011)(7699016); SRVR:DB6PR0201MB2455; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0201MB2455; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0201MB2455; 4:w/26OB43hSZpOPtptSkQHh2qo5UxX7tuxOyDluOqob2UnHJREN8BR3/EH9sNtvIjAWIWVO58uvZHiU0LIjz/CyM7jgYagcxAQzkoOxuogREm6YtHTJfnPpsAa2bUTU7gYtyoE+qMT2jQ73QgBo5799h9tp1rDYHxPHeE7mNvI+rAWstSsIixheGrt3Qw1MQ94XfFP5UY6RpTrNw7Q8ikyS5QKBZ/PX16ONBq9tleLeOvJ64gngzlEZTy9TXWSaguHNnqE0geWz8kCMnH6hgBSA== X-Forefront-PRVS: 07562C22DA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(39830400003)(396003)(136003)(346002)(376002)(199004)(189003)(2351001)(11346002)(106356001)(446003)(74482002)(105586002)(316002)(4326008)(47776003)(6116002)(386003)(66066001)(3846002)(25786009)(6506007)(16526019)(186003)(1076002)(97736004)(956004)(50466002)(48376002)(2616005)(476003)(68736007)(486006)(76176011)(2361001)(26005)(16586007)(52116002)(8676002)(53936002)(478600001)(6512007)(36756003)(86362001)(305945005)(5660300001)(54906003)(81156014)(8936002)(6486002)(2906002)(6666003)(6916009)(81166006)(51416003)(50226002)(7736002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0201MB2455; H:orc.pedanet; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0201MB2455; 23:5fXkhIlo7+XJUcBHdihQs+NdNRKBdVXs6wBwvaW?= 75l47YOw7dD/hyQtaWUV58AK7zJ5gUO8HbJ/7p6JwEaHMEinWBErioaT3jEp/D97c9lA4CGiJaVKBGE97GmXjXo6+/IWoybEaLoXNl7VeuDH2ZT1xEKS9/fzo3KMjzQjlbefZsDCp2yqE6h7c+P4o4a/wPajEwQlt3kQCNXEEETVaW42Qt+gBOM7tM+eAVxOx1HTVGFuQPGGCN+ouI0X14frLb02VXUxaTdj5F4hWg6uSY3aw94FibH53Jx9GkU3M2aNs9o5BrBcbeIYrJBOLSulP/B3i1xYgLGzHZ/vAvtQiOOt1jba1a5Zu+Zp7YexhdTNnFV1A/RpozuktTXvIlHpatQ2DDEBTj4diDu/ppeOQgRqKr+x9ICYYDpPW7HDqUF8P2t6fxQbC2uPO/XVwg0Ut5F6wijAPkjQ7IazIPu5A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/VU/FPE3YdoumgJcIcP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2018 06:19:28.6299 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 24bbea72-9ecf-4345-be0d-08d5fb649132 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0201MB2455 X-Mailman-Approved-At: Mon, 06 Aug 2018 08:20:19 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , dri-devel@lists.freedesktop.org, Vincent Abriou , Peter Rosin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Removing the drm_bridge_remove call should avoid a NULL dereference during list processing in drm_bridge_remove if the error path is ever taken. The more natural approach would perhaps be to add a drm_bridge_add, but there are several other bridges that never call drm_bridge_add. Just removing the drm_bridge_remove is the easier fix. Fixes: 84601dbdea36 ("drm: sti: rework init sequence") Acked-by: Daniel Vetter Signed-off-by: Peter Rosin --- drivers/gpu/drm/sti/sti_hda.c | 1 - drivers/gpu/drm/sti/sti_hdmi.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index 67bbdb49fffc..199db13f565c 100644 --- a/drivers/gpu/drm/sti/sti_hda.c +++ b/drivers/gpu/drm/sti/sti_hda.c @@ -721,7 +721,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) return 0; err_sysfs: - drm_bridge_remove(bridge); return -EINVAL; } diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 58f431102512..932724784942 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -1315,7 +1315,6 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) return 0; err_sysfs: - drm_bridge_remove(bridge); hdmi->drm_connector = NULL; return -EINVAL; }