Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp471844lqb; Wed, 17 Apr 2024 01:40:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUzRSqTd0oKqfcPb5TZZCw0MAVVgnDg+8SCDax4h2oVBC3UIwIHhqSZ3ZuDq4K1cMQve96G66wj5LbakYvtsi7Xfy0zUNfQWJCuCeBoAA== X-Google-Smtp-Source: AGHT+IHTD/9NKcudfPgXVLpDLwD/yEvOQB1BrFBPebGu+aTwJHHWKkkF2wfCRbFeCYTiUWV2l+Ua X-Received: by 2002:a05:622a:1495:b0:436:b949:8ba8 with SMTP id t21-20020a05622a149500b00436b9498ba8mr16028879qtx.38.1713343217408; Wed, 17 Apr 2024 01:40:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713343217; cv=pass; d=google.com; s=arc-20160816; b=MRoI8oKOGWHFgo9hjd0DlwZodELzTqC9aclbH1Vz7y6xzq98T8lqGSDGctyVB9Qt9j SDEtORHGqhVEQkHBJpzKwO5Rnhq+LviFhPGpLLF/7DtFhP7eACvw4xujEjHXl1nLmTNB oj5+OZ2DCloiiwOategiaYXLrFEq0liuJc85s6q1xwWD2jzmfWIifFUq/39ejl34tZw3 xUdpbiRvNRZ61933tFM3J6Afi2ycF8wVkBQjSlWa2ODj5vCddzHxWKNpt5J3CYbOL+PJ ctC2baOc8NPWDIi1pEQZLfQcO3SAhWWoLsGLIUbxY5CTxmN0MFIxCXS7xVIwN5g3+o6J DKzA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=3oBb2Jxy2Ybu4r/36NBuRq6SpEcCHicetK1xzOBVseg=; fh=OVYVsJyDZ7qgfJddczTGoy4O19XtqYJTErKN+GwQHm8=; b=m2bJv2f5p+c3oRmnu9y7Rh0dGbXVZDIFfMzRrnYxa9jmXDfXy+0sl0A7e7qkiHyHie XCPLU9DS8L3JVE/8P1RJVMWZksmIe0C8etmln3SFFhhjfhBzqDH0KLvzzsGLOlv4vP3o qtibNsV5/8tkmAAREi944AGN1XQP8sFq/duWiZe0JHuHSHE1WEwIDmEpWVDrX1WtnXj3 KE4/LMjl455vKT7eNoLxXpw8XmZVT7DL0Q+/TIetQjZ6rM0o7ktBJDTFIfwRxP4Qlhhb 7ze7/WD2VYmwMUzNiRS4BYsc6TtLnLZy/JGUD1PQeySEtGfXNzJ/hHStybP0m44s/C57 yFIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=nfschina.com); spf=pass (google.com: domain of linux-kernel+bounces-148158-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148158-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b6-20020a05622a020600b004367f8cea78si13001524qtx.587.2024.04.17.01.40.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 01:40:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148158-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=nfschina.com); spf=pass (google.com: domain of linux-kernel+bounces-148158-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148158-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CCA541C214BE for ; Wed, 17 Apr 2024 08:40:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37C9A127B5F; Wed, 17 Apr 2024 08:40:10 +0000 (UTC) Received: from mail.nfschina.com (unknown [42.101.60.195]) by smtp.subspace.kernel.org (Postfix) with SMTP id BA9607EF1B; Wed, 17 Apr 2024 08:40:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=42.101.60.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713343209; cv=none; b=kzB1gYr1ABQu1uQQIPdTTSJRVR0YcpBfwkgj5XBetPPTVbEKPUPIl+7yuejNmdw4u76o/gO81SCQTpoIE4vJuM84mBdilwk/31LxYf8Up59Vw5/gNCrxF3fVII1PoX70ElT/z+4srOiZn0k16DCIcDbbWg+InZbLWR/PRSF/I6w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713343209; c=relaxed/simple; bh=bkdtrhw2AnU57Efat4BsX7bkcfARUcoIOhyRCKyW95E=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=aJY5sH6+eVR9vC0sK5CRQUqGW+YJiA9kdiYxSJ1852yluY4f1YfwqZERfUV4uHgC0rS4wa/3YAttUOFOWBszFLVQGMeXJjqBttbRIpmZ9GVVgKu4PcYb8+3CsS7lr5eoEN8gWNOZsSbZ0UoGE/FHUmffC6kIOb+gO09CfFdZBcw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com; spf=pass smtp.mailfrom=nfschina.com; arc=none smtp.client-ip=42.101.60.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nfschina.com Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPSA id BBB506061BF4E; Wed, 17 Apr 2024 16:39:47 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: kherbst@redhat.com, lyude@redhat.com, dakr@redhat.com, airlied@gmail.com, daniel@ffwll.ch, nathan@kernel.org, ndesaulniers@google.com, morbo@google.com, justinstitt@google.com Cc: Su Hui , bskeggs@redhat.com, airlied@redhat.com, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, kernel-janitors@vger.kernel.org Subject: [PATCH] drm/nouveau/disp: fix an error problem in nvkm_uconn_new() Date: Wed, 17 Apr 2024 16:39:21 +0800 Message-Id: <20240417083920.2256027-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Clang Static Checker(scan-build) Warning: drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c:line 215, column 4 Value stored to 'ret' is never read. Return the error code rather than zero when 'conn->info.type' has an unknown type. Fixes: 8b7d92cad953 ("drm/nouveau/kms/nv50-: create connectors based on nvkm info") Signed-off-by: Su Hui --- drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c index 2dab6612c4fc..6a67d307bf79 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c @@ -213,13 +213,14 @@ nvkm_uconn_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, struct nv default: WARN_ON(1); ret = -EINVAL; - break; + goto err; } nvkm_object_ctor(&nvkm_uconn, oclass, &conn->object); *pobject = &conn->object; ret = 0; } +err: spin_unlock(&disp->client.lock); return ret; } -- 2.30.2