Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161155AbbKFK1u (ORCPT ); Fri, 6 Nov 2015 05:27:50 -0500 Received: from mail-bn1on0116.outbound.protection.outlook.com ([157.56.110.116]:24209 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032269AbbKFK1r (ORCPT ); Fri, 6 Nov 2015 05:27:47 -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; Date: Fri, 6 Nov 2015 18:25:39 +0800 From: Liu Ying To: Philipp Zabel CC: , , Subject: Re: [PATCH 1/2] drm/imx: ipuv3-crtc: Return error if ipu_plane_init() fails for primary plane Message-ID: <20151106102538.GA2036@shlinux2> References: <1446632158-19998-1-git-send-email-Ying.Liu@freescale.com> <1446804354.4569.2.camel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1446804354.4569.2.camel@pengutronix.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD016;1:2QG+Zno2tm1rVaflLa1UKPA12c+CJQFHkpMsstCnf234/94H3ZY/zoSvdns/spq7UlzbzpODgz5Tczb4A36WiY+5D/AHVohs62u8IxFWFRwAml64z8HBGWMFerjOFGCa5n9pVgQ2WgU50qobn4EraY8TwUiGCaM2hP3KMTeWzLVf8VbVjdyu21o8es+Ld5TopfYhXuPoR+8mB61HYjEyDM0R+ePuScMElC0SBgbES1thfJi+xtvBp/tspmkQvZAo852HcmTgLb7ionsggcjeTyQ7mMD2uRbkPVOT1wBHDwObFzR6YyG23Em7RNMSrOrgoWcbYGe/fyJYQnHINhjynj6pl2y8af9l3feuAjIFe1li82lZT7+KGr9PXLxUT2Jz X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(164054003)(24454002)(19580395003)(83506001)(46406003)(2950100001)(104016004)(5007970100001)(189998001)(106466001)(105606002)(110136002)(97736004)(47776003)(6806005)(86362001)(97756001)(5001960100002)(50986999)(33656002)(54356999)(50466002)(76176999)(4001350100001)(81156007)(92566002)(87936001)(85426001)(19580405001)(77096005)(5008740100001)(33716001)(23726002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB0638;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0638;2:K4GnxihuTDV2CIWc0Ddh6KnaR8TcK3knUuJRZEpxdbgr7ygEYz2/64lpzTbapS8YXhhsEStdDJUFVaif68ePg4/6zulQGnzSlXYb/rRmBqqYRFbm8YPYFDCrnj4w9RZJptoI/t5ZVwK6QhqwgMK53TjYpRmRCEbLlH+Pxwk+uFg=;3:WSLiJK2MEow2oYoOz6fwJe8IDhS5lfpY0DPLBcajpY9o80NRi51JnVQI4tuLaB0UXHz4JfWg1Bwchpe1RcBZgVNi9RptiX82z2SJCymtdqSiyTPKcPmh+6SJfmt68W3yLst+Pdl6z9ZYitTmwkIgX3Wo5b2MqJdFhdjSWxY8FpfppANeRY0TCxEnNLZstWR0hsZNjUdRClByImKwYjaMG+36Y/MUCKCIYgG4eW4+wWw=;25:v2l7gHhNZEsM1l6/SntqOCJoMXvJbvClMM/nG1ZBz1ycsjIA/OgF3KAlQcuSdNqAtR31gbSt7mfLd15974CDFqBOpgWkYLx9tGgB1BVmxuvoN+b6eDa8NbcYU9qHUADCIq2eH+SS6aTDsmV0Sy07q9sBbk2L2fgoI9hw1jbET6BlDGE0EOqL8ko91BkqTYAiQB2Nnk5Y99rY5hR8H9VaodU5FJSBxnh9A5rYtneDdfk8iJhgFjReXlnS11CUcDj4d2I/fJdKAVVIioPrZstmVQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0638; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0638;20:06JHzZeN1DWIWmddgi092doDKbtDBXX5Uj1yLFz5uUhhcPI+yMXzKpBFNUd9pUOPIk6o84W3vV+TlXK7GK3XLRe/e9belrPjNv/RfmbVMReOdys8mMrdE1N9hkAiCqAU8+ejNbtWkPC98yJO968xdbKYFzH7SB+dmJYjnCKWXT3Ty5yTmhF3GEWRYH2PAciaQIDPAX+0i17AoAOBrx7d9nXdsWjeERThb1oilJwnHx1hxE2LKtTaegxsKc1MAuOLNe31qkm+96iNgFg9svxUOQei2mITXT7HApvahZFT98P+Tn05VFhOegAD0SsQVFLgGzn3AnfrRAlIyT8mQRL8aXITzc0HnXMfjrBokGpc3q4=;4:Z0JiIm3Ib7aGuGZ/W0p8y+idqP7hPKwru4+TaNi+QvcnvvRuL5eiA6hbf37yu1kMMTqaI9kmT/zFu7eQecKk9sPNOuhTw9noWsW5CZc1ETUKjgB/Fk0qXrNsJpeIBSLD0xOmZC0knXeouxcc9VZru1WDV5FtnhB61TLnq67gXnoRe/+OKhxv/M5SHNqbi8pnabNOH4VI7rWmi+aJTQ1lokzzQLN/6jjYiB/sSkBU+18O2eOew+5DwwqMp1iQIGoHwKA4hv6+IWFp1JTfKL8SKll81DGKmJTmgbb0Bs6zEdvoHd3sicBZsSBlwFFtkHg6VkFbL7rdvvo7hPjj1NR+8E8HT/p0NrqUJI5vFCadfbxj1i490eRIbKWvYZMLEzhE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(10201501046)(3002001);SRVR:DM2PR0301MB0638;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0638; X-Forefront-PRVS: 07521929C1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR0301MB0638;23:FF4L7/IQpL1VscsGq5mi2pteACZKn0vOxAViTRN?= =?us-ascii?Q?XoAEUUPXGkulh4QKvsSypjJPVoDpHlZzYQO4oNXAP3q25uzGRnya9EPNq7v7?= =?us-ascii?Q?9JuEaQgoHhJ0wgI/ZdD3KkRfJMaVw8vf6P6QmsijrFViooueBMKtDhQPWltz?= =?us-ascii?Q?x909/3KRkClUq4vC9gMqJArl456Zc9fu/kHWDVM50z9w5kUTXxGZGfRl6+QI?= =?us-ascii?Q?wUjGnoigdn/GxltKr8tZ7PwI8+2auhRgIwOUZHQ1xT4KIYSKw3IZOhFwJebd?= =?us-ascii?Q?aA5hckb+LHvcc9AWVfmuDEba2PhB+JdGvE3+l4tRJ2BbGYMOvabCWGBJf8cW?= =?us-ascii?Q?fw1F175Tp5qD/qOL/MJ84wUeP5JDgu6h9s13Z/RqNhJV+ujnLSRr7FCEBcBI?= =?us-ascii?Q?bjd+9srgUTeqyeidqnIJv+BpKQXbFNcGzhHrBFXQfDMdBFfVFjPx6s8U11Tc?= =?us-ascii?Q?AL7jQYDiLipl0AbtFADxKUt3vP87b1+DNAfv9SqKKYiwBnM7mru7fD9gkypd?= =?us-ascii?Q?5NqDdK1q+EVd2ztk9B0sATzhOCws/iiAVbw/fCqgdaYrVCgrGUhETewdhJ4Y?= =?us-ascii?Q?WFJb0S3dEquX0tj6DcPVisshqjvBhRXuQ3sq4SPzXUCyGj9IfriCtNz5aXYh?= =?us-ascii?Q?oXX/xknfJ/8ZOXJ4319Pgh6nwupkoqS7okbKxSw347A2Mtv8yTsdh9U7+FDW?= =?us-ascii?Q?9FkGGW2svNF5lGeudnlnHRPQaBASSMWbZ5/dGDwpZK5J75+KlokogMK33+39?= =?us-ascii?Q?neFDxML4Bxf8l1GmopstY6H0broRADUYH/uUAhEO3rihzyOsJWQIDcX8ycQ6?= =?us-ascii?Q?4sUsnO1df+lmTRSSN/NEqO1hs2h+265Xqabh8aOVKhsoQtbbD/UZi6QpdsVR?= =?us-ascii?Q?z4JjxyGplbtoW18RItnI2Dtz6hImFpihMhpRMHUcSiK5HKHWcgvZf6s9yHkf?= =?us-ascii?Q?piHLt0L0gGGZqCWJnsl+Dv3bu1aIOlA7FW3mRf4yE6455OEEFrlIPvP+i8VD?= =?us-ascii?Q?Zy/BOHUjt5h9yDrhpFpb5NsZGQ/IceLJ39H7hNcOhCjg8FDSz2v/GJeYYM4G?= =?us-ascii?Q?3rjn4Hbb9r54Ywfg1/b5fQi4gX6gd?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0638;5:08fFWNxO4mUEDmA83c6pb/guquzye7zmJGI1i0GdmnFqt3jTYbzH9x/snuZ/GuSHa7l2HbtGOSLV/37zJwRMu0kxOl3+EtRQYRLZoWWTWP7Z9AuacsG+f4h4NAtGJrjnD93w9HbGEK6LOcuHNG+zSw==;24:AmbrhDVeBpxTHJ7pk7eRO+XP/kEc9slif7CHnRhVZzGIG4i+bJXgYl8FU42IbFKAbQTDH1lc3cB20FJ54mybXbXy9T14XVBGcwSrXU+c0hI=;20:Dg+ZMWsoWSqLDOuFCtRW3adj2V918e+W2Fybx1uajgypFbTs5/Cw88kXbL9SN6fSF6Vyap1FB3IDZ29WCH4hCQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2015 10:27:43.6503 (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: DM2PR0301MB0638 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1579 Lines: 44 On Fri, Nov 06, 2015 at 11:05:54AM +0100, Philipp Zabel wrote: > Hi Liu, > > Am Mittwoch, den 04.11.2015, 18:15 +0800 schrieb Liu Ying: > > 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; > > That should be "goto err_remove_crtc;" Ah, yes, you're right. I'll fix this. BTW, there is nothing to free the ipu_plane allocated in ipu_plane_init() in case something goes wrong after ipu_plane_init(). Of course, we may fix this with another patch. Thanks, Liu Ying > > regards > Philipp > -- 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/