From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CE9EC4CECE for ; Mon, 14 Oct 2019 14:59:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7092620873 for ; Mon, 14 Oct 2019 14:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571065174; bh=QJD4EzBr3IYCpeHhs8CEgaUVDyQ/CTBvo36EPyEtoSM=; h=Subject:To:Cc:From:Date:List-ID:From; b=PfHGxrpB1LplwmMFPBCvYLhQnR7e0zu/laG2Sb/P40SB7xfxpXn9Mk6e+WZdeX7/w x0P1tjeL0WTL7ShHn4RlH+RkGk2x3H6yYF3J1ZDBuXgbwcFHkuktCKiX3KhfR8yQ+b O3vhgVbYF8KR92XLatAaH3IDCEjq80DjlmOqhMKA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733057AbfJNO7e (ORCPT ); Mon, 14 Oct 2019 10:59:34 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:47317 "EHLO wout4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732518AbfJNO7d (ORCPT ); Mon, 14 Oct 2019 10:59:33 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 33C97913; Mon, 14 Oct 2019 10:59:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 14 Oct 2019 10:59:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=okQn0u U5r0uNhqp2hY6HXWdEVEQZhr4I+d/NtsAvA4E=; b=OIXogA48D2FG7J8tfMThtQ LEkHN+RRwUoG3jyAbag+IiDxhbGgTzL5C3/mbT/ZPwXfrSAtgsf8KFMTmTQOCbaF xp2OhPlKsBWGd2qmKaekwINRofiXejPUlZOdRUQn2M/c9zsb4S+J/zyfX7DpUmqf LCtbQPkpUp3DusRWcOWKK9TgNA7Bn1TY6KoAZC64Efbgj4PHOzH6qcP204Lpcz7/ y7X/JqUnFzvGnIOVEnB+T9crZ3J01OS5HD54I8h9Gg2AFVfFzeBvejmZn9Ugru3F Lw/cQ3zNdim0vm7BLr9wONS4N+qF54qD/dbGf5LNPug1tBAWmkwqxOXkmrr7YISg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrjedugdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeekfedrkeeirdekledrud dtjeenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhmnecu vehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 1183C80062; Mon, 14 Oct 2019 10:59:31 -0400 (EDT) Subject: FAILED: patch "[PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc" failed to apply to 4.4-stable tree To: navid.emamdoost@gmail.com, dan.carpenter@gmail.com, gregkh@linuxfoundation.org, stable@vger.kernel.org Cc: From: Date: Mon, 14 Oct 2019 16:59:30 +0200 Message-ID: <15710651701597@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 5bdea6060618cfcf1459dca137e89aee038ac8b9 Mon Sep 17 00:00:00 2001 From: Navid Emamdoost Date: Sun, 29 Sep 2019 22:09:45 -0500 Subject: [PATCH] Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc In fbtft_framebuffer_alloc the error handling path should take care of releasing frame buffer after it is allocated via framebuffer_alloc, too. Therefore, in two failure cases the goto destination is changed to address this issue. Fixes: c296d5f9957c ("staging: fbtft: core support") Signed-off-by: Navid Emamdoost Reviewed-by: Dan Carpenter Cc: stable Link: https://lore.kernel.org/r/20190930030949.28615-1-navid.emamdoost@gmail.com Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index cf5700a2ea66..a0a67aa517f0 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -714,7 +714,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, if (par->gamma.curves && gamma) { if (fbtft_gamma_parse_str(par, par->gamma.curves, gamma, strlen(gamma))) - goto alloc_fail; + goto release_framebuf; } /* Transmit buffer */ @@ -731,7 +731,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, if (txbuflen > 0) { txbuf = devm_kzalloc(par->info->device, txbuflen, GFP_KERNEL); if (!txbuf) - goto alloc_fail; + goto release_framebuf; par->txbuf.buf = txbuf; par->txbuf.len = txbuflen; } @@ -753,6 +753,9 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, return info; +release_framebuf: + framebuffer_release(info); + alloc_fail: vfree(vmem);