From patchwork Thu Nov 30 07:26:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 171752 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp209283vqy; Wed, 29 Nov 2023 23:26:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8GhuXDMiVEjAzd7wX5RxnKoz1/g1pQb97JRZ7lrY9GHs1uMnWvrIw0Q7FfRqO17OG8t6a X-Received: by 2002:a17:902:8bc2:b0:1cf:cc23:eff with SMTP id r2-20020a1709028bc200b001cfcc230effmr3098400plo.52.1701329207517; Wed, 29 Nov 2023 23:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701329207; cv=none; d=google.com; s=arc-20160816; b=Z8Qvgr6YuolOotI9Dr+f/fZOctjGaG2P41+wlfe2Fs6JNKVrbA3VBXiZzHYippyaGN JIGNbrh/zhQT4gdjW3lqWDrq2C5MmUlvL1QCotPgXht/h2ijn0jjkexCvDLb6WvdGePE 2ye6vjO8ZZ9I9XhZzQguv/3AxZY9xiu/qwYrASQvg9pxia2Cli1a1UfLna/ojYqUC2bM DFR5a4WMicisfk2erARLE1g/km562ptoBcgzup8711hZoAgN+GBVc+6O7KIzUff2nyXn HdRkGopBJ8hLGKx0/sr2g+GfRDP3PvvTw+dn5cjrEsL5dZtrbPf+m5w3+n5PVDMDZeNZ 8F7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=fxfaT7Lx/SLvMXZ8BIazUPMWfseGLyrbhSm3CqW4/u4=; fh=3YsDNDRpkKQkDlxg+U6dAKncT3ZMeGqzPaHa+RMYP6M=; b=OP4ydYBJqHaFwyEse0m4TQ4+z93whMjNDJA/U9i8mKNl2Av3PAT+qGlihNCxUTHzq5 M0qrmtMA4rIIm7oCczrAscax+ZqjoTP5gTYWSmQdxNzP0q13FndHpICZoj4oB+SmQkwE kLB5/GXdWxWwFkxlOie/7FR82CNzdKWKbJTxKOKsFQhns9piceL3bxrr3QAL6OF6mPjy d1We8bXq3Wl0tunCitnN2D7UEAyA1MQ8a2cZj+rbnCkV7QzupUVGP5hhn8/D8VxqabQC M4HTRXs80ch/SHYkI8CjbHEEjwRJvfthm8GkzeLa/D6FHWALZkbMNETXsVyPYEjpLPyG V+hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ob9Yq46A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id n3-20020a1709026a8300b001c7345bc01csi596223plk.450.2023.11.29.23.26.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 23:26:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ob9Yq46A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D7B31826E61E; Wed, 29 Nov 2023 23:26:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344719AbjK3H0b (ORCPT + 99 others); Thu, 30 Nov 2023 02:26:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbjK3H03 (ORCPT ); Thu, 30 Nov 2023 02:26:29 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A529310E3 for ; Wed, 29 Nov 2023 23:26:35 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-332c0c32d19so445791f8f.3 for ; Wed, 29 Nov 2023 23:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701329194; x=1701933994; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=fxfaT7Lx/SLvMXZ8BIazUPMWfseGLyrbhSm3CqW4/u4=; b=ob9Yq46AtWZwUTmefP1KR39gcE5Oq1jenZW7ksI4rWwkSmkciNf4vXXMKACA79LwWe 4eFZluxYfHpyZBEAq8JPZr2hQmBtFUR6/ATVDyyy1mIZiq81pV0V1A2FkF7LhX48U0In P8xBuwcsg28T6e2ZOZBd8Tkv2oUmzzCftLj+Sm10+w0+6idlnaHcg4KKYhRW5hYUovLy M/rxTL/v/M4/i1zJ5z9Tkqnlz4sTZiH513Rg/OgWdiuKmX5BbzFTogMtumIOuyFqIXk9 2qcYNe9mGCytC0zQvNsDFfMjg8CJ5q/Xy6EafLPpau8Xz/8BX09HZjiva9rzc/P7QARe yqXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701329194; x=1701933994; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fxfaT7Lx/SLvMXZ8BIazUPMWfseGLyrbhSm3CqW4/u4=; b=fME5rrar56LBOGqtVcUzNwMpCi9UhdAV1CYWBZdGz/83pSJnSCeVDsVGC/pQG+JfQq EmK4pu1W+fw8R0bGrQZLFyVTFeVSaKebF/JVm05mM/9AmJwmt37w0FBZmE9023ErQ7s6 njHSVZHjngJks5MRqBfOHFU2Ahf4TjArUUlPIKg7kUC6RdYskdcYrzpuaMgWPouW2KVh jBkg7hKUxSTUAjfSNom//mX01/3AxK6WE7bgzb+oq+Z5LCtRfPfujTT7JjUijTgwC3KU 5vZ4Im5BWSgqKovLl8qQooVPMpKNQDmm1EA80bLVRrzKhUtK0I3PEy8C6AFZ+WHnfQy5 KPuQ== X-Gm-Message-State: AOJu0Yx+hJV4tGH9h/ogrTrBzQwFBtSYyt6JvTgiW/VNWhr7IIePthkz pLpxbmx/zq/AtHXBjea+MsPb6Q== X-Received: by 2002:adf:f88c:0:b0:319:7c0f:d920 with SMTP id u12-20020adff88c000000b003197c0fd920mr14168970wrp.57.1701329194008; Wed, 29 Nov 2023 23:26:34 -0800 (PST) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id c6-20020a5d4cc6000000b00332f82265b8sm702358wrt.4.2023.11.29.23.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 23:26:33 -0800 (PST) Date: Thu, 30 Nov 2023 10:26:29 +0300 From: Dan Carpenter To: Sarah Walker Cc: Frank Binns , Donald Robson , Matt Coster , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2] drm/imagination: Fix error codes in pvr_device_clk_init() Message-ID: <1649c66b-3eea-40d2-9687-592124f968cf@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 23:26:45 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783972974995701141 X-GMAIL-MSGID: 1783972974995701141 There is a cut and paste error so this code returns the wrong variable. Fixes: 1f88f017e649 ("drm/imagination: Get GPU resources") Signed-off-by: Dan Carpenter Reviewed-by: Frank Binns --- drivers/gpu/drm/imagination/pvr_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/imagination/pvr_device.c b/drivers/gpu/drm/imagination/pvr_device.c index 8499becf4fbb..e1dcc4e42087 100644 --- a/drivers/gpu/drm/imagination/pvr_device.c +++ b/drivers/gpu/drm/imagination/pvr_device.c @@ -105,12 +105,12 @@ static int pvr_device_clk_init(struct pvr_device *pvr_dev) sys_clk = devm_clk_get_optional(drm_dev->dev, "sys"); if (IS_ERR(sys_clk)) - return dev_err_probe(drm_dev->dev, PTR_ERR(core_clk), + return dev_err_probe(drm_dev->dev, PTR_ERR(sys_clk), "failed to get sys clock\n"); mem_clk = devm_clk_get_optional(drm_dev->dev, "mem"); if (IS_ERR(mem_clk)) - return dev_err_probe(drm_dev->dev, PTR_ERR(core_clk), + return dev_err_probe(drm_dev->dev, PTR_ERR(mem_clk), "failed to get mem clock\n"); pvr_dev->core_clk = core_clk; From patchwork Thu Nov 30 07:27:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 171753 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp209440vqy; Wed, 29 Nov 2023 23:27:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhLgOUtMoXiZMNRI+38hl5xTxXb9q2HbNUgrzj2k4F/T09wCiqAvpgABCQkNSyN4IECPGz X-Received: by 2002:a05:6808:1486:b0:3af:9848:1590 with SMTP id e6-20020a056808148600b003af98481590mr26971305oiw.6.1701329236596; Wed, 29 Nov 2023 23:27:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701329236; cv=none; d=google.com; s=arc-20160816; b=MYwMFo38np3vtJPTXL+2E8SJnLke1z059ZKN14wXJphBi/aQJmke9DB+WUqOVPHhEZ 8qdjPUeRvdP/32738ylHacfSuEFAlr2A1kQvie8t0mFxrad+fsGQHrpPZ9jtcmgfxBL8 a7gah2B24/ymSLyZadxL0SobgF3ytp53M9PvUWkM8QnfEz1WpgY5+5qUNtZWNkefVkJp 68mchpWauyOJ38pOz22GRvewUDVHstWD5nv+Eeg8pRGQfQRmljSu+46ybEhQet21JuT6 5B1kmiqlS2nrwpSwd3FWLi20ERYdTWIdG49F/p3A2QaNrk5CjXg0deya5ORbF3qgHJlz ZrKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=x09g6G18OJ4KcEcTHhYJRdvLAtb4UmkCF9sOQ3/Txus=; fh=3YsDNDRpkKQkDlxg+U6dAKncT3ZMeGqzPaHa+RMYP6M=; b=Ei9871essfWK9wcvavRKYC1yRaDvwfiet3wRtI7ZWTxGQgfN/MalyURYNkW7XCdhaQ mu5hFeYKUOOswfK4CS4pbAwVD7Ak9S79B0o1RdbAuFoVv0/PTHfKsu/ZQ8Id711SmMJl GhTncpz+C4pyNBAL8x0v8EG9stZAn0DAU4LYeS2/89ud92Tfk6m+npFXAsukXCagm0On poV4ZA3dOH4i08x1VhJymtb5Xe1pe07qyPz51Wh9CeUQYyGXumOCu2pmha5oeryDG4pK lP+vlImRldIf6ZeRVJ03v1wsdRtz/lzNs2kSEVNR6Cbdvo8KOqUKaOcCyUNnZSr+8iXA C4Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dzn7XD0g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id x129-20020a636387000000b005c5e29d5053si787729pgb.149.2023.11.29.23.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 23:27:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dzn7XD0g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E240481FEC72; Wed, 29 Nov 2023 23:27:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344693AbjK3H1D (ORCPT + 99 others); Thu, 30 Nov 2023 02:27:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231713AbjK3H1B (ORCPT ); Thu, 30 Nov 2023 02:27:01 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0A9710DF for ; Wed, 29 Nov 2023 23:27:06 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3331974c2d2so444887f8f.2 for ; Wed, 29 Nov 2023 23:27:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701329225; x=1701934025; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=x09g6G18OJ4KcEcTHhYJRdvLAtb4UmkCF9sOQ3/Txus=; b=Dzn7XD0gltIe0SPdCy+jw1iMN67c1mZ3QEdI6Gcv2J+6W0FIOjfzvr/ybeMzxDbC10 rJl9ABvBF8O7Z3m+Gt0eoiZmW4i8I80hi0Bn/Yw0ePRqKZnJDVUkMN5ZZxnwXsRPLWzh EJHD8cpRXIDpCQMiHHvapyKhScdg+zSpTH43kbhC3+1iZh5qDeZZlZxFVVIn9K3nrM58 daYja0xfgeVrEwDdG9Hm0jiNLNkJT4Rk/GIGAowGWUcrnVPcBCuB0wB8cRSgNUM8AkH4 NZrHgvAr2ZMgGIUcsEbPhYaiowwBU48NBdp/XZ5/xBK8J2UJdvMGt1/E/FkLNVADMKr+ hpzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701329225; x=1701934025; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x09g6G18OJ4KcEcTHhYJRdvLAtb4UmkCF9sOQ3/Txus=; b=PKB2c8ky8+pMUkYcuC3LssR3un5A0DZBVN0VSz6HxmnXM6oY28oipF6q9/vSSMXH+0 08dH4eh028Qum1/GzDY7Pv8i3ZtWHgmdMWXG620OkHx0cRpkaOeyKioPaUGUWt8HZvTN 9bX8LjxKyM2uNgMYOEY+CbcCEfHLExVOsviifi4U60GLQQXctu7U8RFIJQx3HQFzuWJT sVHRyFzFRSxNclSLOJEXbJIwB5kOuI1HY3Uj162gEtKWZ3lFwTUtIiMAGck6Wkmcf0Xp YVPJfv5lWvwuAQflPweuEmqlmMnwH8ckwLdOvYl6gq8+zxLTbdb3hr2tJVtpDTgXC9VH hl1Q== X-Gm-Message-State: AOJu0YyVYE+0a6GyYYzJn/LvSahsOo1irjcEjkYRM/JP0YKC+6cIDfVF 42usK/EYj8Q6KzXNZXbj3VipdA== X-Received: by 2002:a5d:5987:0:b0:333:145c:ac01 with SMTP id n7-20020a5d5987000000b00333145cac01mr4260949wri.44.1701329225311; Wed, 29 Nov 2023 23:27:05 -0800 (PST) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id w18-20020a5d6092000000b003142e438e8csm693983wrt.26.2023.11.29.23.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 23:27:04 -0800 (PST) Date: Thu, 30 Nov 2023 10:27:01 +0300 From: Dan Carpenter To: Sarah Walker Cc: Frank Binns , Donald Robson , Matt Coster , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 2/2] drm/imagination: Fix IS_ERR() vs NULL bug in pvr_request_firmware() Message-ID: <384288de-a779-46c7-869d-b3c63462e12b@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1649c66b-3eea-40d2-9687-592124f968cf@moroto.mountain> X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 29 Nov 2023 23:27:13 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783973005829627411 X-GMAIL-MSGID: 1783973005829627411 The pvr_build_firmware_filename() function returns NULL on error. It doesn't return error pointers. Fixes: f99f5f3ea7ef ("drm/imagination: Add GPU ID parsing and firmware loading") Signed-off-by: Dan Carpenter Reviewed-by: Frank Binns --- drivers/gpu/drm/imagination/pvr_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/imagination/pvr_device.c b/drivers/gpu/drm/imagination/pvr_device.c index e1dcc4e42087..5389aea7ff21 100644 --- a/drivers/gpu/drm/imagination/pvr_device.c +++ b/drivers/gpu/drm/imagination/pvr_device.c @@ -286,8 +286,8 @@ pvr_request_firmware(struct pvr_device *pvr_dev) filename = pvr_build_firmware_filename(pvr_dev, "powervr/rogue", PVR_FW_VERSION_MAJOR); - if (IS_ERR(filename)) - return PTR_ERR(filename); + if (!filename) + return -ENOMEM; /* * This function takes a copy of &filename, meaning we can free our