Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161570AbbKFOhE (ORCPT ); Fri, 6 Nov 2015 09:37:04 -0500 Received: from mail-bn1on0115.outbound.protection.outlook.com ([157.56.110.115]:21568 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932962AbbKFOhB (ORCPT ); Fri, 6 Nov 2015 09:37:01 -0500 X-Greylist: delayed 14178 seconds by postgrey-1.27 at vger.kernel.org; Fri, 06 Nov 2015 09:37:01 EST 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 v2] drm/imx: ipuv3-crtc: Return error if ipu_plane_init() fails for primary plane Date: Fri, 6 Nov 2015 22:42:45 +0800 Message-ID: <1446820965-19028-1-git-send-email-Ying.Liu@freescale.com> X-Mailer: git-send-email 2.5.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD048;1:ULqQ12tenjUFi2f+v9+bWpKyfs3n6xJirY9bXct9s2ho0OiLZh3RjBv96ylMFtkmw+s7MvYGGJIClMJfqeV14OJdFk4daiMII8e0I84oUHXOXCGK8BXE7Qgm8NUdnKv1cg0wmaCnaO8JJ15C9v3/POkxQepTYvyoWfzQpKTw1yq/CpHxNIAQCIYJW2xHJzPktSKIh28zVhN7cDXNTDQnWXGk8j/PFEjfl+n5MY4549yD6vHrv5UXyQVaqbkkfMXpZUoMkezO9jk+bTsVX4DKqENCuuwkQAj2zM+8fpRMXBN57Ri1qodCytKoboKv8QbjR6UklrxJeE0H+yLhhdXRHAwMkI1YqJAMQ66f2QKohxJNWf+aoBNtObTZuJLgLSyX X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(5001960100002)(110136002)(2351001)(50986999)(229853001)(97736004)(87936001)(5007970100001)(92566002)(47776003)(15975445007)(189998001)(105606002)(106466001)(86362001)(5008740100001)(50466002)(11100500001)(19580395003)(19580405001)(5003940100001)(104016004)(81156007)(50226001)(77096005)(6806005)(5001920100001)(48376002)(36756003)(85426001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN1PR0301MB0627;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;BN1PR0301MB0627;2:lCiCR+oGx6uEsdaUdIMtCBMiKVVukKKx56+huoRTsKoxsQcJx5x7qexOszH9SmrpamCO4rZ61EwNuwIyv1Yg6GVI7LJLglnbhiwMs9uHmiDgV0qlOxFIw4d1Qv8jMmhMiottSom1uZfL6uk06FzID5rHRtAHqlOA1502iLOepgI=;3:GObmJg01GgtP0kdkrNbN0VZlBD0ca1d+OGrlTYz8Cj7epe2Mqqs9i0SeU6qppLpKSkkuly7eaBgN8pUIWynNHbl+3I86ofKcQtqFVRJN3OK1baA++nazL4S8ZAemlVXuxpWeSZlYv4KDGzFZstT0yGq8XgCXTsjNA9GWDM1yEU/o/knviPZfydKW6cDUCkH8uz4WwATby5V5dLyDLlh3WRchULoWb+hWAD5Iy/MO04k=;25:3EYxeGQ/QeBKNtfadDR71FOwsp70TzQPfj77IJnFPJxHNhxFFAPBqJijJlFt0M09L/NX79n5yoceqD8Ht7LFpXB0S2iZCmSTcUtTPscRMMAbhpDsfE98cPBjsApAoOLadGoscqTefj5WRQkjnK1HchO/ctSwt21yMbOZEEXH4yMjqSh9w7u8Ue1zqrOZzWQW0bn30F5P8yrx0rrGDZuuNv43kzr6YGdRhY8WWhLYCk//TXRG9b08V0hQ4lSyTqmvzQhZjIr5DZHlSMWJTmfTiA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0627; X-Microsoft-Exchange-Diagnostics: 1;BN1PR0301MB0627;20:FZZVfWhJ0Oa51NV6OHda+ZdfpfJ3rylSS/oM3BGhVDWeLM3ZBcZCmsKE9U7mA2BFYI4LcQ2DnpEQeI0NzDmBDOLLWE/h4Qjcx8Dau6kRTdLIwkdP1Pu8UjUH3/pyE0jN7ZcFm6vMcN0vBGnrNEnWRYcefWyFgjAFF9GuUIAbCHYc0858VtAKJLpc4EqivWB8YjoCO59uzPtFTiYN08eLrgVYJ3Iud2O9UmN5IcbJa7LDiaFBbgFHik0vN+BT7HmZdjd3XfgERdi2o8zIJBHxqyf+JZmtf8NlEi5ckM9WJ7Qc0DcJ5WadRw23xRkR5JLpnNSOXBJ94VRX0gNy/i+c4wSjjOAvS/G4LUoGO28Mz14=;4:0413HjIN8VgpITXSt9olnzu5UKidYTFr0oCgFLY+ikmuMt6aW+/M/ySafHo0d/fIZq+s/eq1C9lhJfF5RTydc1jYG+zoiM+IAJavYnaA1kccZc4OfsjisqeXRCU5oSk+Bf03/xL5xKbj+Wkx5j8OeqvY3YAMwK7yEyOOxcsnof4PF5DqAE0BcPgrJClBV79QhgTsSlg0qbGti5br7F2+6LghTlxiZSlSeXM/72ZA9mJHjVWwMPdgv++jgOoU6CcyJCYL9SLogEY4mDsM2cEJcNTTQLJGPbwv+Yc7/CILOGWoUiAG8j5B9muXhYADPjyQnu7WE9Tz3kOv6F1mjZf7AVkkGtsBiNcmT0umxaP37SCR82WZUG1tLb2aZyQuzNCX 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:BN1PR0301MB0627;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0627; X-Forefront-PRVS: 07521929C1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN1PR0301MB0627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enpZ?= =?us-ascii?Q?FJUGU1uoONDIHG+ieD3ezTeDXV68I9foacFgWIBzcXmcppdznfO/Icr6NMeo?= =?us-ascii?Q?Dh9viBS3WpGa67aCdFk1Z0/g9exSv9heChWR8xuuTo2V7cwJX/2KYNGkxxcx?= =?us-ascii?Q?v4XlgyrKv/xywSGZa1LYCwsjfgvJAlE0mBs7j5JCZ/14JWg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN1PR0301MB0627;5:NHW6uMBIspLsmxgIf9SwKOLXmZifxWbsME8F2iSqKKp5kByG7fppgAthx21YtAxGTXROvxJDiTxoFULLis2e3vgEFmeCSPZ7bBzG2RmO20QfGPXe/Jrzi6/l6W+41URrxuYruJSRBxibDD6ocmabIw==;24:s+/37Dn0lYERC8DI+cIhWIMxfcg7QIg9Z2i0Z2Qs6mpcGmccBfVK1slca28Ev0qN3mzK2aFBvsRwn+rxfeGvPhBxxaGVZxe5Va7sviKOqjI=;20:j9nAarldwGNKqHSjKKm6djdVYs6gz5yTLK3wsLKtDAcJAhrfpZ4AnOeXpvo7OIc2bwfuqQIhxxnpUvNYZkJW2Q== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2015 14:36:59.1858 (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: BN1PR0301MB0627 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1314 Lines: 37 For primary plane initialization failure cases, ipu_plane_init() may return a pointer encoded by ERR_PTR(). So, we should bailout instead of using that pointer blindly. Signed-off-by: Liu Ying --- v1->v2: * Trivial commit message fix. * Rebase onto Phillip's patch[1]. [1] http://www.spinics.net/lists/dri-devel/msg93700.html 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 872183a..35a77e5 100644 --- a/drivers/gpu/drm/imx/ipuv3-crtc.c +++ b/drivers/gpu/drm/imx/ipuv3-crtc.c @@ -361,6 +361,10 @@ static int ipu_crtc_init(struct ipu_crtc *ipu_crtc, dp = IPU_DP_FLOW_SYNC_BG; ipu_crtc->plane[0] = ipu_plane_init(drm, ipu, pdata->dma[0], dp, 0, DRM_PLANE_TYPE_PRIMARY); + if (IS_ERR(ipu_crtc->plane[0])) { + ret = PTR_ERR(ipu_crtc->plane[0]); + goto err_put_resources; + } ret = imx_drm_add_crtc(drm, &ipu_crtc->base, &ipu_crtc->imx_crtc, &ipu_crtc->plane[0]->base, &ipu_crtc_helper_funcs, -- 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/