Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp406657iol; Thu, 9 Jun 2022 06:18:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdZXlk7apz3qYZ+Lnp56Geqf9lyTxfez9ucMd/25pTnckvRIf11wyxfktDDC4sHGk1QQ5B X-Received: by 2002:a17:90b:1e4e:b0:1e3:47e4:92b6 with SMTP id pi14-20020a17090b1e4e00b001e347e492b6mr3450892pjb.47.1654780730755; Thu, 09 Jun 2022 06:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654780730; cv=none; d=google.com; s=arc-20160816; b=dMObo73rDpPILfVULjQVl+3gF3mkFwz+NBRVAgC2gjRZfR6SK1N+L13WqQa/0UbFo8 oba9oUl1UHbcumgV/cjAXhNtgMn6n+u2ITwYZf4kiuqmEEmUf0/FVTL//XfTMIhxwNFs K2WI65viKCn1dylPFCv0d7g4u5E6l9/K+O2QHqLGsrT0rTG4iwSMxRlgbcGklf7flYBP uAR1Du5s0aKhiquf5V6TnzLKoXHuRn77QEdgDvC2Xk5P8rSKtIZUS3HXHvYSIyxLoGWw AowYzrBDC3kMIVHjIz67090MR3pmQ9EqLsbYDqzNTc8itJjmFk6lb7Z9HlMR7v2zmwkh o4BQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=punjJeFPlmRDX9hAGHT1aIOyQoqMIzoy0YlqW9TJhb4=; b=0i4XTKzSSEB9WlivOyf/J4NPf1z4qZiWWhY2WpeoAbpI58TdzzdbDqi3fiTaI9q0v8 U2Om8q972vqtx5SFchY3Ttcq5Zb5YZl7kq2Tw5Jbsn+pu+RAq4TVyKs22q+Ky95khSQf rDm4nZmivYY7YaliK0XfNj6FkpBnvASxE6C36bGFwAPmiX/goaeEc5PLibmvwc2igQnc cKUa6aJQhXGLbxYplV2iw97DZuIV0KpLIdOqTG++1hhKoywQnlsLuHRWNzGG05/a2gx8 0jOxD5gu68F5UeMkKYAkm4uaLSoxnx0QYExvPi9Vc65qHzRoqQ7/0SD/Gs0ba7rXauAc /ORg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GUIeGMCJ; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a170902cf0400b0015f2b4a29ccsi33710966plg.253.2022.06.09.06.18.29; Thu, 09 Jun 2022 06:18:50 -0700 (PDT) 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=@bootlin.com header.s=gm1 header.b=GUIeGMCJ; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244068AbiFIMor (ORCPT + 99 others); Thu, 9 Jun 2022 08:44:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343783AbiFIMoX (ORCPT ); Thu, 9 Jun 2022 08:44:23 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1F5152B0C; Thu, 9 Jun 2022 05:44:21 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 85FE840008; Thu, 9 Jun 2022 12:44:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1654778660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=punjJeFPlmRDX9hAGHT1aIOyQoqMIzoy0YlqW9TJhb4=; b=GUIeGMCJ/TpP5lolE/xpASVDI30ycU3EKxyOyBXRY8SxkfGoHAOmoPxM/4WlL5LfUvnGoz pPbC/daIZfrRJECTdHXkfTJq5kGE+APPmEq00Hsx0Wundptu5og1SAU/L5LxV0qtVrcNHL 1fKYEvEfbtOWlUSufANRJKzt83xCHTdjB/RtyH1NcHA+/5mMZwaMAoLXfEVpqi8Ag0PHwV GNg76ZZkBi6b1GwZ3cMEWY7Vnq7rY/ichOxSKAecQu6FVAzvZlNFZL6k5YHSKL1mX8o2g5 OtmH0I58JTaJBfz+sILr7KG6laP1kUsR5GfMXu5BT3yk9O/ikGqMD9FOtsS81g== From: Miquel Raynal To: Christophe JAILLET , Liang Yang , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Yixun Lan , Jianxin Pan Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: Re: [PATCH] mtd: rawnand: meson: Fix a potential double free issue Date: Thu, 9 Jun 2022 14:44:18 +0200 Message-Id: <20220609124418.209251-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'ec0da06337751b18f6dee06b6526e0f0d6e80369' Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Fri, 2022-05-20 at 16:41:40 UTC, Christophe JAILLET wrote: > When meson_nfc_nand_chip_cleanup() is called, it will call: > meson_nfc_free_buffer(&meson_chip->nand); > nand_cleanup(&meson_chip->nand); > > nand_cleanup() in turn will call nand_detach() which calls the > .detach_chip() which is here meson_nand_detach_chip(). > > meson_nand_detach_chip() already calls meson_nfc_free_buffer(), so we > could double free some memory. > > Fix it by removing the unneeded explicit call to meson_nfc_free_buffer(). > > Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") > Signed-off-by: Christophe JAILLET > Acked-by: Liang Yang Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel