Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2808487rwb; Mon, 15 Aug 2022 11:46:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR4pt2+22cWteor5fsXEmp9FG265jA4ucRq178HqxtdyR5tOi3FpZG1ydL2pmTR3s9zNbOue X-Received: by 2002:a05:6402:538a:b0:43a:298e:bc2b with SMTP id ew10-20020a056402538a00b0043a298ebc2bmr15341365edb.125.1660589161069; Mon, 15 Aug 2022 11:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589161; cv=none; d=google.com; s=arc-20160816; b=PSqBKA87vGkhG6UcPA6SyHkil81kdbDKzeAnioXab5iN72iB2ybENFmdAiSb7wGe6e cZX5N3kdCJwd8IHw2ajaLFw6k/4eb6dyuYopsr2dg1WskGG9ecZiaYUen3tAUFGtyIho Nhz91BESxwlFlYcofG8ViTf0p5lVUA0iJjjPEvSIeO9XH5zizAaCfkK6mrGgvUoRPYp7 q6m/6HqJDa8ONIKnH180Yt4GdgGDNkfFnje47AF9cvm1j4W8eSbp3QU77L9Jd6NkM3DB 5KKfyLh1FMy28nYmvIIUl/m0gc8p+qKEH8CV3QSC5Pk42WXjhk283y4gYRcBYJUTFJZ1 p0sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M99rUsz7mE8jzs2rjwKREf0s4Sozpc/LFcoW4HwOnnc=; b=FbHnkkUsS8+EoC0UIlSb9aMUqVVq7jGQf2jmSKmmTfFbKIHDeW6J8JKoTsZ696GeoA yT2KR38Mk5sERNpZGxMbrrllIethpZXqs9m412twOFzOJCMQb8W0uKYCzOminZrH6RhS QnW9mIeeJrn/Kb6l0vtjIUNcFSv6lNbskQWeYgE0kpPKor//X9t69Eh20EfzEO4RC76s gijZ47wB61GFO+Q7RGE6QW5RIOMCOyEb5dm0OYTqlA78orRu3KjapvF/ipl9zhsMGHlt Ax+YRjo5konJ4DSFZ1mfW46rqz+2kGUVHb8Veou82Uo44rjO4On5NCA/4LHjTb3Ai6pj rs5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WU3oipX0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a056402430900b0043d6718da9bsi9769045edc.83.2022.08.15.11.45.35; Mon, 15 Aug 2022 11:46:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WU3oipX0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240429AbiHOSUF (ORCPT + 99 others); Mon, 15 Aug 2022 14:20:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240052AbiHOSSy (ORCPT ); Mon, 15 Aug 2022 14:18:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F8C22BB10; Mon, 15 Aug 2022 11:16:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBDEE6129E; Mon, 15 Aug 2022 18:16:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6027C43470; Mon, 15 Aug 2022 18:16:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587377; bh=y5dOMvY/vtWmTZ442l2tNq7mMPfl2pLTBxrmgWBug+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WU3oipX0VDGhbYtPg0QcCeq92WgfhEiUN6Wc+MTT4aeyUpWVVeCOVTxlDZc6TWHjw xMlWOi4+So9GXHwumvlezf4V9DBOLnxCAJb+bwYlTaG+nm5xr7vQm4DzHT3eGtSzNJ UQDWUJVFvizvO9YAqrkkTaLySDNJaUd61yxr0S5A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lyude Paul , David Airlie Subject: [PATCH 5.15 067/779] drm/nouveau/kms: Fix failure path for creating DP connectors Date: Mon, 15 Aug 2022 19:55:11 +0200 Message-Id: <20220815180340.137533901@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lyude Paul commit ca0367ca5d9216644b41f86348d6661f8d9e32d8 upstream. It looks like that when we moved nouveau over to using drm_dp_aux_init() and registering it's aux bus during late connector registration, we totally forgot to fix the failure codepath in nouveau_connector_create() - as it still seems to assume that drm_dp_aux_init() can fail (it can't). So, let's fix that and also add a missing check to ensure that we've properly allocated nv_connector->aux.name while we're at it. Signed-off-by: Lyude Paul Reviewed-by: David Airlie Fixes: fd43ad9d47e7 ("drm/nouveau/kms/nv50-: Move AUX adapter reg to connector late register/early unregister") Cc: # v5.14+ Link: https://patchwork.freedesktop.org/patch/msgid/20220526204313.656473-1-lyude@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/nouveau/nouveau_connector.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -1361,13 +1361,11 @@ nouveau_connector_create(struct drm_devi snprintf(aux_name, sizeof(aux_name), "sor-%04x-%04x", dcbe->hasht, dcbe->hashm); nv_connector->aux.name = kstrdup(aux_name, GFP_KERNEL); - drm_dp_aux_init(&nv_connector->aux); - if (ret) { - NV_ERROR(drm, "Failed to init AUX adapter for sor-%04x-%04x: %d\n", - dcbe->hasht, dcbe->hashm, ret); + if (!nv_connector->aux.name) { kfree(nv_connector); - return ERR_PTR(ret); + return ERR_PTR(-ENOMEM); } + drm_dp_aux_init(&nv_connector->aux); fallthrough; default: funcs = &nouveau_connector_funcs;