Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3026674rwb; Mon, 15 Aug 2022 16:24:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR76Oo2wDHKkygqvL1vGiI6T+I+rqapT+GBlJSMr6mrXFCikHt8Bbdax8Y44AZpA+vagAFgS X-Received: by 2002:a05:6402:1d54:b0:43d:280c:f25b with SMTP id dz20-20020a0564021d5400b0043d280cf25bmr16712277edb.379.1660605889979; Mon, 15 Aug 2022 16:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605889; cv=none; d=google.com; s=arc-20160816; b=R2bnteI3t1lqzVVezb4XDckoPHqzyeQixBZc+sl+wG4zCg28Fsb+4+6Z1cS5+xxiIj OktCw5wzGUPvq4aCsfceZ3maq72NO4KIpbmmAf/fIigmh49vlgd5GrWLDh8PmfQzMLgq e2WciQWySDvQ5v9Zf4f9xRUhxc1KyRcdugRyVfWsS2Ez+1PBBz3iSB+OZskt7VJq7/Rf c6nBlUiCVGp2AVWOLlLoA/IBV+Qxl/08C/R6HUD3CNFlkaoLHhCp3tBELxCX9uT1XnET PbhQ6sc4rlAuoT5Fgscy98hU/Q+xsLKs4t/5OwBJQ0fm199eI+xR3Gu/JoXimkmkTQ/5 fzog== 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=HneZ4OiX3BgrCED1HTVIu7uRGoCaBbx1mYjysU8snHJgzTaw+sjVcDdrNivl4sIi1O uwz9gW7b68WmpCU+zZrGQtxN0ScLGOuMuSbeW41JnHeXidgTFu6ptupHihqcK/z35b/T SBmC/4RwfE0DT64VELYGFEyqlt9AKOrHVQKtYXTQ4Ht2T0Ss/6wA0KVUORNdN6YjDhdW lmmZaDEW/32OnV3SC/p6TOEpoztQIKZUgoC9cWf8uwqGiCoiuv8hGrW3gmN1foPBnxUe bor9Wt9v7NFFq5wUkZPXOyFPboylT4rp+BrFk2ammhAxV4FeqR5Xl+ePyvEM4304mqHB 8MKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E9Su9uB3; 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 kd5-20020a17090798c500b00730ce22906asi8498410ejc.876.2022.08.15.16.24.24; Mon, 15 Aug 2022 16:24:49 -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=E9Su9uB3; 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 S1347499AbiHOWNS (ORCPT + 99 others); Mon, 15 Aug 2022 18:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348759AbiHOWLS (ORCPT ); Mon, 15 Aug 2022 18:11:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C0C611B4D4; Mon, 15 Aug 2022 12:38:39 -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 ams.source.kernel.org (Postfix) with ESMTPS id 3A3B8B80EAB; Mon, 15 Aug 2022 19:38:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8375BC433D6; Mon, 15 Aug 2022 19:38:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592313; bh=y5dOMvY/vtWmTZ442l2tNq7mMPfl2pLTBxrmgWBug+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E9Su9uB3/zDmDi+/xcjnPkEQiNxbwoZsjTpSPGU2X6pfxlwojXLxZuiWzpHt+VFed oFGmsgkLY/E8vQYmrHM7Mb5Eh9mGCLX6pX9Mku3O9lGkoO0lXozMvQLosVr7xaxjp6 XJPYMLfiDbFgjqIoVRXb2lNI+RiVZOt/YBJydgFY= 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.19 0092/1157] drm/nouveau/kms: Fix failure path for creating DP connectors Date: Mon, 15 Aug 2022 19:50:48 +0200 Message-Id: <20220815180443.265484705@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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;