Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1528886imu; Thu, 13 Dec 2018 17:28:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/U7qOz/jUi6zUx/w66MSepdFWUc4yRgvIH0BNbVs0kGK6Uw8pIvlxw0bPQQCiixGjXqtSld X-Received: by 2002:a17:902:1127:: with SMTP id d36mr969980pla.299.1544750907717; Thu, 13 Dec 2018 17:28:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544750907; cv=none; d=google.com; s=arc-20160816; b=qiKPqQOlgXWXUKPRkc/Rx9JjOhyfkr/1Q43gU3leAib9u8cJDeS9j7VNayHL4zyu5H wD6LkiYk1b2Fy1zPpPjuHYzy3A2wOyjkT/o6jgq+yPmpfA1zZQPg/1IfGgNR8ywvfp1b 29X5pB/kZ2xSSGGdXsy7kIcNyJ52on+RPRwOkyfy/LbAb6OyoCFRaiLeKf52CTSu43+j ZEThyNwn6b6tAre0vSb2SJjEwjUI7uh3AIqxqn3PiqTlRdoNlkU9cRURLFdPpkMuqiQ5 /ushyluuXFzjEO2cs1LFlEUimMUX9djeyFRBo31sL502IyUDRCluO6ud5/JMt6YCLLn/ wU8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=hCGFpnkYtJMDIJ0BuIc86NEEowsjNFEIhpxmL9vpIG0=; b=ZUPa7y2wZAXFywbesgDAf07fzxsr043nupK3v5CkP1HVBb2pUvjCDcOnETmsC3hPxC sDdVra5FGc9S+3TuGSXA4Vzat1eIQLmwi9+Rxg7jY4TN3Rq6y1sF5wYDoSTtyBM9V4BJ HEukj20TuNgSx9cQx2oz/WrLOrZJulbEeoWMrD035rxPX8H2ztssrdvIeq3rdBnpqOK7 8Dy3hggJaxGSKmb82j/z67SM6KjS6TImVCiIvwK2bsegWYAe1xwUGKPTl5/+qHKboC/G rwaRu66wkNFyaFkCKqRc7HTFQeWQgI4YPF0bGOa2RrKlNSPyAvcR/7iKEAukek/HxWw2 At9A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 39si2742560plc.153.2018.12.13.17.28.12; Thu, 13 Dec 2018 17:28:27 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729462AbeLNB0t (ORCPT + 99 others); Thu, 13 Dec 2018 20:26:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36850 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727901AbeLNB0s (ORCPT ); Thu, 13 Dec 2018 20:26:48 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0207F7CDE4; Fri, 14 Dec 2018 01:26:48 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-11.bss.redhat.com [10.20.1.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DE1E6012B; Fri, 14 Dec 2018 01:26:46 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Cc: Daniel Vetter , Dave Airlie , Harry Wentland , Jerry Zuo , Ben Skeggs , David Airlie , Ilia Mirkin , Sean Paul , linux-kernel@vger.kernel.org Subject: [WIP PATCH 07/15] drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector() Date: Thu, 13 Dec 2018 20:25:36 -0500 Message-Id: <20181214012604.13746-8-lyude@redhat.com> In-Reply-To: <20181214012604.13746-1-lyude@redhat.com> References: <20181214012604.13746-1-lyude@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 14 Dec 2018 01:26:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Trying to destroy the connector using mstc->connector.funcs->destroy() if connector initialization fails is wrong: there is no possible codepath in nv50_mstc_new where nv50_mstm_add_connector() would return <0 and mstc would be non-NULL. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 26af45785939..641252208e67 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1099,11 +1099,8 @@ nv50_mstm_add_connector(struct drm_dp_mst_topology_mgr *mgr, int ret; ret = nv50_mstc_new(mstm, port, path, &mstc); - if (ret) { - if (mstc) - mstc->connector.funcs->destroy(&mstc->connector); + if (ret) return NULL; - } return &mstc->connector; } -- 2.19.2