Received: by 2002:a25:6ac4:0:0:0:0:0 with SMTP id f187csp5373087ybc; Tue, 24 Mar 2020 15:07:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvBwf+CRU5tlHa/qHxJe93MMPbswntpZNzeExELZwScHlbLMkOMWa0SsFEKrG2J5w9RI0B8 X-Received: by 2002:a05:6830:1c77:: with SMTP id s23mr182622otg.191.1585087635505; Tue, 24 Mar 2020 15:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585087635; cv=none; d=google.com; s=arc-20160816; b=gu9ZbYQf6WEL6yp1+ruQYmStRobF99mhsMd6FBIW/23oFHTX1MfETmwWS2+vfPGwYd MdXQTkHh6lb0u8fs0rPj18kXq0LCdgeWN0DNj8x5JmOopYWxGhWo20TYiDVvCJSRwX/N h8jLQaZivtYtx1vFv2D8IYFwNkRdx187keXuTwgbVQ0XO7qr30DpV5Aar9aPyWh9JVkC 7ErFgICCm/FqT4Ur/cfRc8eo0ZisDPFECuJwVjlefkIo4W8VY612uiG1Bbwpe0VZ0+Vl cXCI8jIOZmTLkoXFVP54F8Koki5kW7rG1YyIpWl7udf44ILOv/V08S7Lg3Z1ZWTWpwDB 5DkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=v4mVD1fJerhdWAuLtdLwot+P2TkYDYsmkCmLDKak/gs=; b=SZvj4nBm1Qp0fuHixYwl3E1c2iI0lVmSHVNJMV5yNQAYpMTAXKHIABI4VmOXUEpXUp e4vXQmI65A1fnT8axuO9lqLUcO+lu6aAUHNd6FlO1bHOHb1iNSgm8pgN8mnutcWdXgkQ wt1iNGF7t5TH9cWmzmcR7sZiz/VT+6jXUv1j5WBRvQNFCLRV2nVHO09qpT1SA0ahIR7u 9HWpFeZT7aJ0jVe+j/CrIJY/pkm765jadpV8fYHSj7rolF69YSSF8hzYHuBvXNk3zBxu uGwgXbh2KEyUaRxHpyGLsa9H+dWLp/sFCSbm0ZfWLOpCij+TAv3FuWdhn3vZ/hcR5tOl wJsg== 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 192si4499531oii.36.2020.03.24.15.06.59; Tue, 24 Mar 2020 15:07:15 -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; 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 S1728367AbgCXWFv (ORCPT + 99 others); Tue, 24 Mar 2020 18:05:51 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:34505 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728304AbgCXWFu (ORCPT ); Tue, 24 Mar 2020 18:05:50 -0400 Received: from localhost.localdomain (unknown [91.224.148.103]) (Authenticated sender: miquel.raynal@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id D43DF200002; Tue, 24 Mar 2020 22:05:47 +0000 (UTC) From: Miquel Raynal To: Wen Yang , Joern Engel , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH] mtd: phram: fix a double free issue in error path Date: Tue, 24 Mar 2020 23:05:46 +0100 Message-Id: <20200324220546.15403-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200318153156.25612-1-wenyang@linux.alibaba.com> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: 49c64df880570034308e4a9a49c4bc95cf8cdb33 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-03-18 at 15:31:56 UTC, Wen Yang wrote: > The variable 'name' is released multiple times in the error path, > which may cause double free issues. > This problem is avoided by adding a goto label to release the mem > uniformly. And this change also makes the code a bit more cleaner. > > Fixes: 4f678a58d335 ("mtd: fix memory leaks in phram_setup") > Signed-off-by: Wen Yang > Cc: Joern Engel > Cc: Miquel Raynal > Cc: Richard Weinberger > Cc: Vignesh Raghavendra > Cc: linux-mtd@lists.infradead.org > Cc: linux-kernel@vger.kernel.org Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks. Miquel