Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1224004imu; Wed, 23 Jan 2019 12:56:26 -0800 (PST) X-Google-Smtp-Source: ALg8bN4EJfTylEPV4SNQjV6AZSDqDRj5xyHAs0WLARWHa2m9Zp4YzrEU/SbN3Wu/s9G9zFOxkEPt X-Received: by 2002:a62:1f97:: with SMTP id l23mr3541139pfj.13.1548276986761; Wed, 23 Jan 2019 12:56:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548276986; cv=none; d=google.com; s=arc-20160816; b=nNblKAH/khtghMo54I25Q+B8QqxQJIU96ukfvM2c/b7ihnqvKL6ja/9Se8dLknJmmy 8VsyqiWuVN+aMhatebxUCeHCBR6xwfEdKFyQmSVWFN6wlQ6sS3CFM+X1ddqR5UwzyFVe XhozNiVJYX7Xi7kxumh1p1vb/uiOz0r8vHQS4ffins1JBZHAAeSbBUkY7hcBt1jQ9C8X BO8ocJC9SffV1lVw9mVNsug+cuDPSBQjD5jVeXR37Uz8teixvH6fkH8n8LQ9qaLhnxIW 70q5zGkgIHOgBoM3dAxY5mVNc5uO+2ezQICXVbvxpeCTZ1QqFWab+PfeoAPdEqr65R0p q4DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=R4GtUxyzgswfoJvrCcoMwOs3N8PkjCiSlW24jVMccv4=; b=Fr8T00svb/6HMK7iD3qIZ50BafDicY0MNooD9BWaoAPgkpJ3cYdemEImn7CIdP8cKI pRo7pBg2BhBvf3awZqYOkUnNwQsokWjpk2m/4F9SktNAGWDg9nAdnEOszDeqsE2n/w+q dK4EiCsfgPSXwxB2FmU7F8k6MXHY95IXdRFREuWUR7z7v5tmXK4Fb1KtGG23wbM5aNyy /6YOKeVY86JzMxWm28CITGoV/rbipr3acfsX+vzxI7SmWbDjhoeQPGFNsnmPirMCtw95 NDP9M2ir+/+okUu9mqJGExcZpryS3AslsR/HwG9NgUUBeg8DEUNVnQeOJd8L+o6UwAdj QR1g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si20228623pgn.551.2019.01.23.12.56.10; Wed, 23 Jan 2019 12:56:26 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726356AbfAWUyr (ORCPT + 99 others); Wed, 23 Jan 2019 15:54:47 -0500 Received: from smtp07.smtpout.orange.fr ([80.12.242.129]:16953 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726274AbfAWUyr (ORCPT ); Wed, 23 Jan 2019 15:54:47 -0500 Received: from belgarion ([86.206.19.74]) by mwinf5d65 with ME id Twuk1z0091btlZA03wukSC; Wed, 23 Jan 2019 21:54:45 +0100 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Wed, 23 Jan 2019 21:54:45 +0100 X-ME-IP: 86.206.19.74 From: Robert Jarzmik To: YueHaibing Cc: , , , , , , Subject: Re: [PATCH v3 -next] mtd: docg3: Fix a possible memory leak of mtd->name References: <20190123092819.5020-1-yuehaibing@huawei.com> X-URL: http://belgarath.falguerolles.org/ Date: Wed, 23 Jan 2019 21:54:44 +0100 In-Reply-To: <20190123092819.5020-1-yuehaibing@huawei.com> (YueHaibing's message of "Wed, 23 Jan 2019 17:28:19 +0800") Message-ID: <87r2d3yu0b.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/26 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org YueHaibing writes: > In case DOC_CHIPID_G3, mtd->name is not freed in err handling path, > which is alloced by kasprintf(). Fix this by using devm_kasprintf(). > > Fixes: ae9d4934b2d7 ("mtd: docg3: add multiple floor support") > Signed-off-by: YueHaibing > --- > v3: use devm_kasprintf > --- > drivers/mtd/devices/docg3.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Acked-by: Robert Jarzmik Cheers. -- Robert