Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2959136pxb; Mon, 17 Jan 2022 09:01:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwu364e26Oin77LYgYbj690owWamofcT18AUQEd85r1PzaCmF2RQmfHrjhS5vwnVbHTWLQY X-Received: by 2002:a17:90a:bb0e:: with SMTP id u14mr2212131pjr.149.1642438904236; Mon, 17 Jan 2022 09:01:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642438904; cv=none; d=google.com; s=arc-20160816; b=FmjDivCDbYRpgieXG+6NV8Ea/Lihoisz3FqjJ3lIBKwJT2FUnkTecLpIKjA3jSG7Wy jY3anG3eA9IBNs4kvvuLFbL8IzgBBbEmWPkZmGFIMRWG7taajlCT2dZ78BOGQsNjkZ+N Ti8ApyHAz9QFKhdn++fsgU4Nxq6RveynTva2ImIZePBhlw0uOf0P0fuEF2vE/O501Wix 8aBpeKOEUE5rtXVmRCBMRMelPh3ApuhopVWDd39WKI7x0t9HrdMvXu1QmPnK8AaTBoNN tACd6uDyOo74/fr0apegm+CYT24eCb7P5EIUI2gJ/6NIkE3TJIMgcctQFRdsYEtVJPGB 41tw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=BEtzxmnMM6Tm4aFw5dyzl7Dg82zrHDn+xLKCSqcIoYA=; b=hmSCpMKOJJmYXipr2pQUzdLjUCBKUHhsS++zjJ3ae7CNoJj2JHAhpk5t4GfQjkjxtZ otU5xDXGNEeqkIUw7YNHE1iG/0CEc0r3xn92qB1MBb9VXGTgsQ1LlaXCv7YlA30K05iw AdoM9mysbcOiZ/jIHCi+mprFb8teWFn1T7INuHu2QZBIVI2e2XBH59IF6B1CHfpB+wF3 BUHy1oY0fZZFEanCH+EmT6Pjs4Z1/eK3WAW/HeNzxcVZvEfcmT3KMZZPwFsIcJ08T67u 6oDgv6np+va5oGxMPyTZv9fy0kCEpLsJAlB6Dh93xZIrwK7TG4S2hocU4bJGZSWi/Tl3 2TJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BZoX3xjz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s26si14509163pgl.132.2022.01.17.09.01.28; Mon, 17 Jan 2022 09:01:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BZoX3xjz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238299AbiAQIlF (ORCPT + 99 others); Mon, 17 Jan 2022 03:41:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238267AbiAQIlC (ORCPT ); Mon, 17 Jan 2022 03:41:02 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FA18C061574; Mon, 17 Jan 2022 00:41:02 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id t18so20499413plg.9; Mon, 17 Jan 2022 00:41:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BEtzxmnMM6Tm4aFw5dyzl7Dg82zrHDn+xLKCSqcIoYA=; b=BZoX3xjzmctBGdLOcR11a7mx2a7G4JSQKkCEsd1DEAWP237u5GCSv9nlsVkLCatXR0 5CQmYevH5xmHtOf9XE9BOJJZU0R1WNFSlKLue7aU+bHtIozo34kbZ5jp62JAUooIOCE+ mvB5bGwdlLyAmazE6sCyNOsSoIqH8KCD7OBHTlxZtqeY2/wVZBlY6mkdko+QMWTviSns 1HXzL9gP+EnsuY6dbKFhtQqit01ts+nIGF+aa954ja2A1kDb6krSsMlEGGmaDAvYXAE/ F5j8iaN8yaDAL9mqsG9bUE7Ksp52819NVVF//7rt/q0PAp+xGQONraWH6UQpW1bNoFdU YxBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BEtzxmnMM6Tm4aFw5dyzl7Dg82zrHDn+xLKCSqcIoYA=; b=nB0FxFAcSVt0ckatvosc59sT9HBALdOYs8F24XbQCkKFI4rytwClod6BRekksEQ8go C+HEt32yn5wgxICKMiJq/KsYvwPrcs0OUicTW4LL5d+r3DU4BEkB0zPopo5zhFOaZTpl lERxAvFzfAwvRBk7st+Tu8OkEbttfDVEAJc3sl1lK6T6z7aj87iTyHIbA/gXTWgEYLaq YLVsTZNdvLFzb8snGKDJGBpF50Z8eomXMHNALkerTevcMsHt1ptoDihm7iweYZo4pxL0 lxMb965k13kdZIaet0qODYBio0W1HU1PuSG2W7V06WyAo/Btm3Uis/phBs6xxd6ZR4xq 9wbA== X-Gm-Message-State: AOAM5324eqyfMmbc+Tif81JCG/nDAirvA7HLPaQZqDbefw6VB1OlAySq XPA9LPIav91xVCQEAPS7JOQ= X-Received: by 2002:a17:90b:3884:: with SMTP id mu4mr16707808pjb.82.1642408862007; Mon, 17 Jan 2022 00:41:02 -0800 (PST) Received: from nj08008nbu.spreadtrum.com ([240e:47b:800:d5d1:d9c9:3c3f:6ba3:517a]) by smtp.gmail.com with ESMTPSA id a9sm12673695pfo.169.2022.01.17.00.40.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jan 2022 00:41:01 -0800 (PST) From: Kevin Tang To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@linux.ie, daniel@ffwll.ch, mark.rutland@arm.com, javierm@redhat.com, tzimmermann@suse.de, lukas.bulwahn@gmail.com Cc: zou_wei@huawei.com, kevin3.tang@gmail.com, pony1.wu@gmail.com, orsonzhai@gmail.com, dan.carpenter@oracle.com, zhang.lyra@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/3] drm/sprd: fix potential NULL dereference Date: Mon, 17 Jan 2022 16:40:44 +0800 Message-Id: <20220117084044.9210-1-kevin3.tang@gmail.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'drm' could be null in sprd_drm_shutdown, and drm_warn maybe dereference it, remove this warning log. Reported-by: Dan Carpenter Signed-off-by: Kevin Tang Reviewed-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann v1 -> v2: - Split checking platform_get_resource() return value to a separate patch - Use dev_warn() instead of removing the warning log --- drivers/gpu/drm/sprd/sprd_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sprd/sprd_drm.c b/drivers/gpu/drm/sprd/sprd_drm.c index a077e2d4d..af2be97d5 100644 --- a/drivers/gpu/drm/sprd/sprd_drm.c +++ b/drivers/gpu/drm/sprd/sprd_drm.c @@ -155,7 +155,7 @@ static void sprd_drm_shutdown(struct platform_device *pdev) struct drm_device *drm = platform_get_drvdata(pdev); if (!drm) { - drm_warn(drm, "drm device is not available, no shutdown\n"); + dev_warn(&pdev->dev, "drm device is not available, no shutdown\n"); return; } -- 2.29.0