Return-Path: Received: from mail-by2nam03on0118.outbound.protection.outlook.com ([104.47.42.118]:51388 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933230AbeAXETd (ORCPT ); Tue, 23 Jan 2018 23:19:33 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Christophe JAILLET , Tomi Valkeinen , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 29/35] drm/omap: Fix error handling path in 'omap_dmm_probe()' Date: Wed, 24 Jan 2018 04:17:07 +0000 Message-ID: <20180124041645.32420-29-alexander.levin@microsoft.com> References: <20180124041645.32420-1-alexander.levin@microsoft.com> In-Reply-To: <20180124041645.32420-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Christophe JAILLET [ Upstream commit 8677b1ac2db021ab30bb1fa34f1e56ebe0051ec3 ] If we don't find a matching device node, we must free the memory allocated in 'omap_dmm' a few lines above. Fixes: 7cb0d6c17b96 ("drm/omap: fix TILER on OMAP5") Signed-off-by: Christophe JAILLET Signed-off-by: Tomi Valkeinen Signed-off-by: Sasha Levin --- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/oma= pdrm/omap_dmm_tiler.c index 7841970de48d..f516b5891932 100644 --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c @@ -611,7 +611,8 @@ static int omap_dmm_probe(struct platform_device *dev) match =3D of_match_node(dmm_of_match, dev->dev.of_node); if (!match) { dev_err(&dev->dev, "failed to find matching device node\n"); - return -ENODEV; + ret =3D -ENODEV; + goto fail; } =20 omap_dmm->plat_data =3D match->data; --=20 2.11.0