From patchwork Sat Dec 9 07:24:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 846520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ezcwg23T"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yv12V2gqRz9sP9 for ; Sat, 9 Dec 2017 18:25:06 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=l6gybDwjZkutymXB93Jm/pOQ60Yov14FJGo+K5Qn2g4=; b=ezc wg23TgLm3rrslXSw6CYgO1OpmgQfYhrYdg+lH1gu1yyDkXGnuk95i6STkai2fEbmgAZK7PeFzZvq1 3qC5JzQTM9D1BrEZSV8Gj6AH3LyB6tm3JiZSsVdGkFzEyNlYrsOUAvGkj8haDlm1UhDZMuwvlYJuy 5tBXvxhlY9J67PEv0I1TgHlOFYOpBZSdW7KHveR/i5K6IW8nPdB/5Hun1NiugxJ4+3N1pk4N7oo6W xukHEIvehKhKcka+Evq6nEbRy4CuJMWQHyAtuPcJ3yxI+Tw80lrUCmgTFW7UBp9RmCQT3VjizIwqY GAX8CAVebJRi9MZD7e7a+N6lb6Vxtag==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eNZVM-0001J3-Sw; Sat, 09 Dec 2017 07:25:00 +0000 Received: from smtp02.smtpout.orange.fr ([80.12.242.124] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eNZVE-0000t0-Sm for linux-mtd@lists.infradead.org; Sat, 09 Dec 2017 07:24:56 +0000 Received: from localhost.localdomain ([86.236.211.195]) by mwinf5d04 with ME id jjQT1w0064DWPoe03jQTXC; Sat, 09 Dec 2017 08:24:28 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 09 Dec 2017 08:24:28 +0100 X-ME-IP: 86.236.211.195 From: Christophe JAILLET To: kyungmin.park@samsung.com, dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@free-electrons.com, marek.vasut@gmail.com, richard@nod.at, cyrille.pitchen@wedev4u.fr Subject: [PATCH 0/2 v2] mtd: onenand: samsung: Simplify code and fix leaks in error handling paths Date: Sat, 9 Dec 2017 08:24:03 +0100 Message-Id: X-Mailer: git-send-email 2.14.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171208_232453_298877_A71452A4 X-CRM114-Status: UNSURE ( 6.69 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [80.12.242.124 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [80.12.242.124 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (christophe.jaillet[at]wanadoo.fr) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The first patch converts 's3c_onenand_probe()' to devm_ functions. This fixes a leak in one path (line 872). This also free_irq which was not handled at all. (I hope I'm correct :) ) The 2nd patch is about an un-handled error code which looks spurious. Not sure if I'm right. While compile-testing it, I had to tweak the code because I don't have any cross-compiler. I commented the line "#include " and the compilation succeeded. So maybe, this include is also useless. I've left it as-is, though. Theses patches have been compile-tested-only. Christophe JAILLET (2): mtd: onenand: samsung: use devm_ function to simplify code and fix some leaks mtd: onenand: samsung: return an error if 'mtd_device_parse_register()' fails drivers/mtd/onenand/samsung.c | 169 +++++++++--------------------------------- 1 file changed, 34 insertions(+), 135 deletions(-)