From patchwork Mon Sep 4 08:11:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1829366 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=C6J3rDmN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RfLvr60X4z1yh1 for ; Mon, 4 Sep 2023 18:12:08 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qd4ga-0006mY-97; Mon, 04 Sep 2023 08:11:52 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qd4gU-0006mL-49 for kernel-team@lists.ubuntu.com; Mon, 04 Sep 2023 08:11:46 +0000 Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id EF2C53F11C for ; Mon, 4 Sep 2023 08:11:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1693815105; bh=osIYdsMbokudrqlOwY35Y2mLhUZ0AE8bWWt+Ip1jHrY=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=C6J3rDmN+01WwtRevlEGfKp71z0TtAsAAssdwV3IQt0X6KFEeZCQ6rnekCAznKutP MG2UNdXG4t0I+9pykCFanYdYZSjpTWUYr7uj5zpHeHRSe7R2MVJi9UwGh3ChKyQa7I f4f33YUbb4+keqtziniCobVNPUoeG2fMDc4DqaGXdGgAq2SC6RFAfyNLwT+S8/XEIs +dG9JXqa0ZArF2hcfFW58M22/1uD81tl3h40GjJ9Ielh9WOb22UjEghZh6d23Ow5Fm nNqU3ZW0/FZNhjLYAR9VRTHB9yOuQ/uaD5LiEm2Srse1JoTBoq3VPEUwHcFYd4+PiP CiTULSO+ULRpw== Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-50084bf5da1so1224070e87.0 for ; Mon, 04 Sep 2023 01:11:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693815105; x=1694419905; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=osIYdsMbokudrqlOwY35Y2mLhUZ0AE8bWWt+Ip1jHrY=; b=EO5SmUTw2Ow2bIjTMkjy3AGCdfkiHkPVtNlp7Kpod2+aU9vp8RCUc52kw82YChK2Z/ MEOhu9vK6U5AVlKNu/8C+ghreBA+r51UpTe6m8LZowBfC3JpbJXoJ2dbG8z1XpC7vsDO 9AnEWQnYXdFcQDD8SajUJY9FXQ4y+nvsxYTOK02Eaq/K0TV7m5m5zFSYsv+sWVYOW+xU +nSp04sQMaYUL9ThkdrDPOSH5xlScO85VDW2Sfl4G1REb1higTYNB/AW3NStrGQn8GuR Nvf7PD4dfrJOPNNeFUHWmth5zPSS7JK+Z0fU6zOoguGIoX5Mrq5AiUguQEjKVLMPCVO/ WlHg== X-Gm-Message-State: AOJu0Yy/DeS6cYGixeHW9Nmghm3FTipwe1HxFB0mpMTs5dQr8ptZTbtx ih/2mUWV99SnVJbIahfIJVmbKO1Rr9y/7Dnh7ZI8jLnd6BFqGO40ya8oiZg1zdm6GCmeqQHO2U9 hEXxOs1+VBpZstgdc8hbyByjiYjbUWGKSJZ3c9PiImtPSkliGrw== X-Received: by 2002:a05:6512:748:b0:4ff:aeef:b582 with SMTP id c8-20020a056512074800b004ffaeefb582mr5178012lfs.66.1693815105407; Mon, 04 Sep 2023 01:11:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyOcVuS355V9W5N3/Sr0Aa2ECE8yMu/PaQfgih+fDk14NNeHGBWx/zTkX2soDyWf2QHCdQbA== X-Received: by 2002:a05:6512:748:b0:4ff:aeef:b582 with SMTP id c8-20020a056512074800b004ffaeefb582mr5178003lfs.66.1693815104947; Mon, 04 Sep 2023 01:11:44 -0700 (PDT) Received: from localhost ([194.191.244.86]) by smtp.gmail.com with ESMTPSA id m9-20020a7bca49000000b003fed1ba0b8esm13314483wml.8.2023.09.04.01.11.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Sep 2023 01:11:44 -0700 (PDT) From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][L][PATCH] drm/nouveau/acr: Abort loading ACR if no firmware was found Date: Mon, 4 Sep 2023 10:11:43 +0200 Message-Id: <20230904081143.25212-1-juerg.haefliger@canonical.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Karol Herbst BugLink: https://bugs.launchpad.net/bugs/2031352 This fixes a NULL pointer access inside nvkm_acr_oneinit in case necessary firmware files couldn't be loaded. Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/212 Fixes: 4b569ded09fd ("drm/nouveau/acr/ga102: initial support") Signed-off-by: Karol Herbst Reviewed-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230522201838.1496622-1-kherbst@redhat.com (cherry picked from commit 938a06c8b7913455073506c33ae3bff029c3c4ef linux-next) Signed-off-by: Juerg Haefliger Acked-by: Tim Gardner Acked-by: Roxana Nicolescu --- drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c index 795f3a649b12..9b8ca4e898f9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/acr/base.c @@ -224,7 +224,7 @@ nvkm_acr_oneinit(struct nvkm_subdev *subdev) u64 falcons; int ret, i; - if (list_empty(&acr->hsfw)) { + if (list_empty(&acr->hsfw) || !acr->func || !acr->func->wpr_layout) { nvkm_debug(subdev, "No HSFW(s)\n"); nvkm_acr_cleanup(acr); return 0;