Received: by 10.213.65.68 with SMTP id h4csp3545368imn; Tue, 3 Apr 2018 06:53:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx49EVUaZ8mv0W6DTuzL7P41VTtzMFH6inhLAS/OBlkuHtaXHvagVD0X0VKcd908R2HV07izg X-Received: by 10.99.136.194 with SMTP id l185mr9338406pgd.419.1522763633273; Tue, 03 Apr 2018 06:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522763633; cv=none; d=google.com; s=arc-20160816; b=s/0ESdi3Noywevu3DN+LuRg47zlOg8bo6AsmRYMvKQOpBn/4rWWef5WvtZEYxcwCH8 ozAiewD+bBM3zuvEelmPGbw3U0ERnL8UvgSciA62XGBhojJloftJ2tecEnI7HrF/DbYw tE3CdOEpFt9j4kA+GL2545lesIz5JjbDwyoFWMkhFvZyXeIK6aRTrl0hO6AAjhtG/Uh5 n6CajQ/nM/aoo+kMaie2lelBs6htulivzTgbO9RyrmQB4RaJ+v7hmzLVGRc62Mck5HoW B85XhSfcrm2x0szjzp0Kr74xEYv5vd8mlQaDZjG59wV5MPtojk++ERzNZf26rf8lStuY tpCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=GoE87s8AIePtFEamd4pWghFGhYnmiYNN0tkhk+hAuOU=; b=i9TJbJA/7PBipeun+ni8itjTbx/0WaIX6/ITrJwlWs7T2Nq3R6jUUpLCI3mOchfzxC SKOcfcvdhBpuSceUNqcztPspdpe5ojT9CoCqHMbvVvtjfsM09I13EJg3ATBJTAKVZv+R +5qkdzNYTTJSZ3Do6wFzhcU+Xb3AXb1Vv5g2WEM88s3u9Ex9M0TFj8kk/Ng/dNnEM1VZ 718eT9nSZ7KPEPsFC+0dVd1NkDhhuAEFzxfwkx2cjyt6oGAYu0RTEBweIrJ3Wf/0ESf4 tAghuJTSEM9qbFjUsqPyBM0nDvQTJ2uMDhHAbweK5tMnLLaDNnU+E7Y1pY1n7+GSZrpi X5qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=CRAJm+fi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si403728pfh.27.2018.04.03.06.53.39; Tue, 03 Apr 2018 06:53:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=CRAJm+fi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275AbeDCNw0 (ORCPT + 99 others); Tue, 3 Apr 2018 09:52:26 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:57664 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750740AbeDCNwY (ORCPT ); Tue, 3 Apr 2018 09:52:24 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w33DY12e113862; Tue, 3 Apr 2018 13:52:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=GoE87s8AIePtFEamd4pWghFGhYnmiYNN0tkhk+hAuOU=; b=CRAJm+fi7jx2p2+wuibkvfDM4esSN6vv1/7F8GIKuzU7UqQ30rYbUiARBQyS4fSdliZ9 DtDs9Yav3ARBVa+WnsXZFAvrSg2qjUqDYToLYuiVrG1JXuKbSrRT3cuCzuL8MR3aGbtQ YKabsB+uZZu1ZSDnfgfC3AndbtNjiV3SyxyJtBv3soxdZaRdsNkTeqhg6cerKjNdGTSU +AcBcIpIl6vETAAhyEjzl4DQnszeFVxzLCuJ/cpgW82rgNo96VYKVPUDq5G2tSsRolgL bWqJ4GfRP/0Tqw+Go+ChoeQlyIc1j5LO5KDHQ+Mz6C9bGBR0HOof5bo0XRJxiFFTU451 Bw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2h4akx83gw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Apr 2018 13:52:12 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w33DqBo4015401 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 3 Apr 2018 13:52:11 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w33DqA52010696; Tue, 3 Apr 2018 13:52:10 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Apr 2018 06:52:09 -0700 Date: Tue, 3 Apr 2018 16:52:02 +0300 From: Dan Carpenter To: Xidong Wang Cc: Thomas Petazzoni , Greg Kroah-Hartman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Xidong Wang <2711406067@qq.com>, stable@vger.kernel.org Subject: Re: [PATCH 1/1] taging: fbtft: fix memory leak Message-ID: <20180403135202.3lj4dwafogo5bwrf@mwanda> References: <1522761268-7176-1-git-send-email-wangxidong_97@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522761268-7176-1-git-send-email-wangxidong_97@163.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8851 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=435 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804030138 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is a typo in the subject. It should be "Staging" instead of "taging:". On Tue, Apr 03, 2018 at 09:14:28PM +0800, Xidong Wang wrote: > From: Xidong Wang <2711406067@qq.com> > > In function fbtft_framebuffer_alloc(), the memory allocated by > framebuffer_alloc() is not released on the error path that txbuflen > 0 > and txbuf, which holds the return value of devm_kzalloc(), is NULL. > This will result in a memory leak bug. The txbuf chunk seems to have been dropped. You're right that it needs to be fixed as well. if (txbuflen > 0) { txbuf = devm_kzalloc(par->info->device, txbuflen, GFP_KERNEL); if (!txbuf) - goto alloc_fail; + goto err_info; regards, dan carpenter