Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965206AbbKDK00 (ORCPT ); Wed, 4 Nov 2015 05:26:26 -0500 Received: from mail-bl2on0116.outbound.protection.outlook.com ([65.55.169.116]:24267 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964845AbbKDK0Z (ORCPT ); Wed, 4 Nov 2015 05:26:25 -0500 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; linux.ie; dkim=none (message not signed) header.d=none;linux.ie; dmarc=none action=none header.from=freescale.com; From: Liu Ying To: CC: , , Subject: [PATCH 1/2] drm/imx: ipuv3-crtc: Return error if ipu_plane_init() fails for primary plane Date: Wed, 4 Nov 2015 18:15:57 +0800 Message-ID: <1446632158-19998-1-git-send-email-Ying.Liu@freescale.com> X-Mailer: git-send-email 2.5.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11OLC014;1:74IakcFAoh7KbPqrGgT7L5t5sKGJh/BacQpsmaeLxn9lb+4jwi/WAHNFGYAdseKphDFiStn2Q1ce8dsAzcu4Z16zXtd/djue4HJ35gX5V+K5+rlw8PrasxOiJcOpR/5zp9wnrlEcDTjYshbaHQ5+sghVB3kSkYUCWg41hOj24gYQeu0q/fySa0ES/lK4Go3jH3z0vXwKff+jF7Hlmjau9PbZyLvQp9PcUgiz3FHR8FaW2dsuFlC/i0al20fmuAKAAdcPVxMfz/q6jnDygiDkhb6zOplfxpaG6ceORZMYNQvKtlidCFZmakbsu39U/ohaA4nXgzSaQAhQRwVYj7rcpfHPXzFnsE/K2tuFgmWBawSmnX+OLgVykoR8tFEFj0HF X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(19580395003)(92566002)(85426001)(5003940100001)(19580405001)(87936001)(36756003)(50986999)(50226001)(86362001)(50466002)(97736004)(81156007)(5008740100001)(5001960100002)(77096005)(47776003)(48376002)(11100500001)(110136002)(105606002)(229853001)(2351001)(5007970100001)(6806005)(106466001)(104016004)(189998001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR0301MB2082;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB2082;2:zCgrDldnBV7JhOwqR5eOA3nTKevKzgGRMUOMNP4I4RxIqTVfiOqMG2+B2RRiDGJl8grJQ6wZryfZm7L2jy6Ima0bKTFZJtolLJbioojveQvIqW+Iy0ilv7I8dJdK6NmqT4ODPMDd40AuWucpunCEqkcpcEIS9QOCsK8IGp3r9qA=;3:5aCDgyPnOOqlKyjjJ5Rz2iGKpukRa5+yHmokfFH+skp79ME3mFJmT2v5j2zAnVVTccZe1imtIsEQrnBTkLUmNyesYBPiFcInPVuDsujc9weFvDqMia5yF6rRgTJ0JjiX5yQKpNS/Wx4CIbRx7edCTI8bfOq/qziNsPyEcJWR3U07Tn2U/MjVBCmsvCgsFu3MVYSs7qDy4jVvDyWdsOWAzLiJ+PskJuQSH6HM6CKY0ig=;25:XUt/xNtslVW+b09RtWYN6msdrBtvIRSP8WB8YuIzeUDKQF8fn9AZCdaUYzPjdBsWukbD6pw6xa3shVUOMHqAWd2EaAFXWjhz/p72ANlFEnwMDsbtYXvQM4bvUCY8Uexh+4DLoVXQtfvY4daDnhAIrTgWEhbgQnaValQTMDybQpLAKcDgbE4RBn4AkBK5T/L4U/lxC8ZSbHjO69M2KqVKU8pPW6ZENYTlqA0PwFRNYawqj47DGskM1tDRTbar/H+hiXA+PQl/8jifZXhJ6Xpz9Q== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB2082; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB2082;20:un5NbY7ULDHjQgO5S+hOuifQOJfpnGgeLtAGOjuolPLPsHNlyyBNHRCtX4P9zpOy7B4SXP+dOiZzn9G5bdGgoEO1m5UPR2tUSIWnx6TsGKweknZrufhWJ7+IdcBtBhvP8Q67WHcbazKx2PSAmHZv0kNOwnIX7CUyHmmXKPwfag0RbfegdfqrKiO/VnLY4WIqvUJGA+hTwhj+rhDdDEsZHsGdOAgpDkbmbgZ1nIDBJG7FF42DvTM6iYldVfODkAunYLZ5lWRgqABvsHIkhn5hYg2bhuou7OwfC1Ng8LCabc2ZlE7FdPn65FaNshuhw7kf15KEssU1Rb+O38YW0A4B4bMktKUhL1XelZn1feH4nOk=;4:TEd8CRkUHOY78n6CQEa5vuUCVyoIZOwBvttWWPKZ2tejvnc0d9uQj10p7lKWaIqLac1Pg4HrNc8PQsAxAPS6ahHDocpc5cqK9QRNneYraPksJtG8bVHMdMbL2tm1efZRFOjXdlFxPAHFT0HKMdKPB48r4hqnGDQVpAK2VlL9OB89JLFy/CXHdTT6o8zdg1Fyv/5SdLYnuJtu173ZFRCAV/w/ALhdG4/GWtIwmquG5mPykJV6hD6+dPISuENMTeEPXyaawezYpCjA+IKYJ+l9ubnJljcyixhxSJi5W7mQ6UrUeauQOIBr5XnPxEmYT0Fey3PS9DNs6CDOmzg4l7KAkc7ZNuMvyDjOeqd0j8kJiz4EjfqyTXUShNY3i8QNI5X0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001);SRVR:BLUPR0301MB2082;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB2082; X-Forefront-PRVS: 0750463DC9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0301MB2082;23:eMa2W/qMjngQu1FhJV7aoVKV28OI+wSu7L+QyjM?= =?us-ascii?Q?eRgsNYBBj5AV9i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?= =?us-ascii?Q?dLech36lp928gOp4HUFNdkyBuLTlec6b4upBoziduRA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB2082;5:LWoEbE8duOa66co3LjQFlvYF6phAacgmZWOtLY6U3rGRXu7Th63834siNTcUWf5etdWVO8GOR/ikWiUjen83x3LlQpRKmIz4uREoxmPH8iSLmSEYzsYC8AEKAvp/YLK3vhQrCyMBkktNUFX6Q56EUQ==;24:Ut105WK3ShjX5ZxFvbMfH96/v/4XSPYwRoSxlfEnFuv6t7DUjrQDFbI3gHU0aOhVYXmzQameauW1vLgc8L2Y7RpcF++cCU6z3X2PUUi4fwY=;20:nrpM8B0+KuUMaEQ/0BGw8US69GKGfCu/irgcWhYcJ7Rd+LSPdLty6Xvqr9dwtwOzsqj27FsmmCljCuKQU6tD4g== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2015 10:10:21.1472 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0301MB2082 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1212 Lines: 32 For primary plane initialization failure cases, ipu_plane_init() may return a pointer encoded by ERR_PTR(). So, we should bailout instead of use that pointer blindly. Signed-off-by: Liu Ying --- drivers/gpu/drm/imx/ipuv3-crtc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c index 7bc8301..8d68697 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -370,6 +370,10 @@ static int ipu_crtc_init(struct ipu_crtc *ipu_crtc, id = imx_drm_crtc_id(ipu_crtc->imx_crtc); ipu_crtc->plane[0] = ipu_plane_init(ipu_crtc->base.dev, ipu, pdata->dma[0], dp, BIT(id), true); + if (IS_ERR(ipu_crtc->plane[0])) { + ret = PTR_ERR(ipu_crtc->plane[0]); + goto err_put_resources; + } ret = ipu_plane_get_resources(ipu_crtc->plane[0]); if (ret) { dev_err(ipu_crtc->dev, "getting plane 0 resources failed with %d.\n", -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/