Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3096750ybi; Thu, 18 Jul 2019 20:58:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVD7CRyM5Q/v/ekBmNjxpsICL9oUi+HNQiHWEllrrZ24EE0NUETidYjtAOJ/X4muuuvAYu X-Received: by 2002:a63:fc09:: with SMTP id j9mr35266225pgi.377.1563508706128; Thu, 18 Jul 2019 20:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563508706; cv=none; d=google.com; s=arc-20160816; b=rCupiSdcZO6HTjkg7mphscMEuCqpqeQcmjPRN9qWhQ+cyBqw2Ezyt3fnpwo3EZ84yg +HNex34EMMOJwNLzUqQfILKoEVKqstci9GyUfQPFuxCnkfoUHet9jKzJ+ElY+XBAYXyX GWumwe+6y37tPFNbMTRxeE+d94yGaGCGdO9rXyIoDFIGJKVY8x43gAqRwyysuRKKuGIl XfBg9P5DISuh1CE/d0dmOQXJw4Gml8G8db0Jkxnez7ENQ/8v1/ehZhsC8a8wuDEd2EEQ Micvx0cnixRTr+2UHMGJW3kLa8SJyoYy4cMB98ts6e+iJ9Lb1Tswng0HrH1SgyAImcgZ UUNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=whiFre3VSW5SHT/nKLXjJq1QtYyf7+5wvZAh0kVBMbM=; b=kDzyUDYOs+iJuDgAsoqciZnyHtdNmPPC+FZnt3kplkHOQOoSrXdMCi8XyCVxa+DoeR gz4H5khBiIEyvIOrdvhTwfQC1qR+pPQVo6uZVVMkejB3Fpvi0VwcHphoA76J43B0RqiX A1CnLz7ReGmt3X4PetywtmbbBVeXJWx0Nzc//wm0x2ejNyVhXCqHIjD/34JYrwu957fk 8+prdPmEPg/SiO+KAfAl/ndwyKz/jmaReMc9qr8zVWyjqJxpVop6EB4EyXoWIwKq8ElG losgGYiayI+dLL8GmKH33RLi5IMXb6pD+IljQ+KmbQSGHNxg616HgURG3feA9sRmVE3d OKKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mpQBqDGH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si2892301plb.29.2019.07.18.20.58.10; Thu, 18 Jul 2019 20:58:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mpQBqDGH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727295AbfGSD50 (ORCPT + 99 others); Thu, 18 Jul 2019 23:57:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:56654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727244AbfGSD5Y (ORCPT ); Thu, 18 Jul 2019 23:57:24 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 064F52082E; Fri, 19 Jul 2019 03:57:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508643; bh=k+gLLS6cAeBNJKlLzA4rmJovYWHIqXeTW9b7HIGfzp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mpQBqDGHtNZ/WMSyYnaKAlFXWOfXCAI8dXegR4QNkSOsdY9qxW3PoujX3uUYhaBkD +TZakwWO2YiLhj1mUE0Kish9VjMF+HhZvTXoOIqUmtF1cMkKGtxxmfSdTrZCdQfK2F zBfar2AFbS1THFlzRbPC02/f0+NF4J2HovmZbY+0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sean Paul , Jordan Crouse , Sasha Levin , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.2 016/171] drm/msm/a6xx: Check for ERR or NULL before iounmap Date: Thu, 18 Jul 2019 23:54:07 -0400 Message-Id: <20190719035643.14300-16-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Paul [ Upstream commit 5ca4a094ba7e1369363dcbcbde8baf06ddcdc2d1 ] pdcptr and seqptr aren't necessarily valid, check them before trying to unmap them. Changes in v2: - None Cc: Jordan Crouse Reviewed-by: Jordan Crouse Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20190523171653.138678-3-sean@poorly.run Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index 38e2cfa9cec7..418bb08bbed7 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -504,8 +504,10 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu) wmb(); err: - devm_iounmap(gmu->dev, pdcptr); - devm_iounmap(gmu->dev, seqptr); + if (!IS_ERR_OR_NULL(pdcptr)) + devm_iounmap(gmu->dev, pdcptr); + if (!IS_ERR_OR_NULL(seqptr)) + devm_iounmap(gmu->dev, seqptr); } /* -- 2.20.1