Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3991604pxb; Mon, 21 Feb 2022 09:41:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJziEBdmt4QWG4XCGjgTkFBNKIji7xx74TXsjO/OUElVXAF/cZlRDl4a91BJKRZugq8mI1e4 X-Received: by 2002:a05:6a00:1704:b0:4cc:c8d7:e54a with SMTP id h4-20020a056a00170400b004ccc8d7e54amr21328427pfc.16.1645465312056; Mon, 21 Feb 2022 09:41:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645465312; cv=none; d=google.com; s=arc-20160816; b=awmXaPTRB3vyBkYvwKZ2TYQP10RdMjDwb2QC/tiRGtETVK2UX4h+7PdfnYTjagRyl4 P865c0zH9MAiRTOJDi9i2HA0xnigWsC/HJ3pBtlU/MPi+l/ukWclT9Mn95WAA796klfX gkSG+xd2wOOHgerFZ7eT5eMUJSlucdlWfSiZ1rfN67JyxS231nvBeTChZcYHngcl2wqd ncxZtMuR7HileUVPzi5bTsb3MgZrcl15klJG8UtMaC3/jJWcruQXs+78INzpZzelWdeP hMNxwEFnKiNsvPS/ti+HFMHxPmsRtDpzbbJGgVrB/WkO1OztuXIIuAI2qyanUFO5ryM9 C2Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3JkcU5TBzbyRqboyZUP29XVB5IkiOaXgXp0jHGoS6MM=; b=xyHlXVW3J1A3+QhGyRTm/f9zkH7r/2X/lAU4qu8jaB4deR0PaxQkWmTc6zH2hEAYEj vlKUNmv6wOVwiiXXauJdPFKYiXNw3vCQfV18ygjKD7AwE91IzV0LDp1D7G0MvqsMITd4 ZvB/bTeYqMwf5qMBxthJRRmbZUTO1+Y6DNpCXikdrOTPqhkZF9s9KcOq96+PY/ctY1oc 16XUvML6+6RcsGodgqsXDwo+n+VveN075xzcyWYasyWk3y375WG90FSSmjiKKE8aznx+ dUQYsSjxDkuwlOKGg1W21AQCS9tPcLjuNown+h3qSn3OCoxpMbZef+4y0kHH25e6gRKU 5llQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OkLQKIZo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3si25565658plm.283.2022.02.21.09.41.36; Mon, 21 Feb 2022 09:41:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OkLQKIZo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354054AbiBUKCu (ORCPT + 99 others); Mon, 21 Feb 2022 05:02:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352336AbiBUJzO (ORCPT ); Mon, 21 Feb 2022 04:55:14 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5231387AC; Mon, 21 Feb 2022 01:24:11 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9EEB2B80EB9; Mon, 21 Feb 2022 09:24:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BACA4C340E9; Mon, 21 Feb 2022 09:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645435449; bh=1RWRw81HnhA40n4kQ9w8rLZmB3UuvQzSg293F+N1jEo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OkLQKIZoeeTHktGpOheE7PlY84PlmG3plrcuqkmlZm0EJKvstjciNWTAbBevIT1h9 JaMm1Ffcbh5neyNVHf7uOhldYpkmVm+SACT2jJ9TDTfPANqQddTUwy+yJtqt9i/gv9 VnyHtTGJz0Ed19y6jdhLgzvZgU54Z+WDwKypVFQs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ansuel Smith , Miquel Raynal Subject: [PATCH 5.16 167/227] mtd: parsers: qcom: Fix missing free for pparts in cleanup Date: Mon, 21 Feb 2022 09:49:46 +0100 Message-Id: <20220221084940.375889431@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084934.836145070@linuxfoundation.org> References: <20220221084934.836145070@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ansuel Smith commit 3dd8ba961b9356c4113b96541c752c73d98fef70 upstream. Mtdpart doesn't free pparts when a cleanup function is declared. Add missing free for pparts in cleanup function for smem to fix the leak. Fixes: 10f3b4d79958 ("mtd: parsers: qcom: Fix leaking of partition name") Signed-off-by: Ansuel Smith Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220116032211.9728-2-ansuelsmth@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/parsers/qcomsmempart.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/mtd/parsers/qcomsmempart.c +++ b/drivers/mtd/parsers/qcomsmempart.c @@ -173,6 +173,8 @@ static void parse_qcomsmem_cleanup(const for (i = 0; i < nr_parts; i++) kfree(pparts[i].name); + + kfree(pparts); } static const struct of_device_id qcomsmem_of_match_table[] = {