Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755481AbcJ1Eq3 (ORCPT ); Fri, 28 Oct 2016 00:46:29 -0400 Received: from host.buserror.net ([209.198.135.123]:58375 "EHLO host.buserror.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbcJ1EqY (ORCPT ); Fri, 28 Oct 2016 00:46:24 -0400 Message-ID: <1477629956.6812.15.camel@buserror.net> From: Scott Wood To: Yangbo Lu , linux-mmc@vger.kernel.org, ulf.hansson@linaro.org, Arnd Bergmann Cc: linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-i2c@vger.kernel.org, iommu@lists.linux-foundation.org, netdev@vger.kernel.org, Greg Kroah-Hartman , Mark Rutland , Rob Herring , Russell King , Jochen Friedrich , Joerg Roedel , Claudiu Manoil , Bhupesh Sharma , Qiang Zhao , Kumar Gala , Santosh Shilimkar , Leo Li , Xiaobo Xie , Minghuan Lian Date: Thu, 27 Oct 2016 23:45:56 -0500 In-Reply-To: <1477625554-46700-6-git-send-email-yangbo.lu@nxp.com> References: <1477625554-46700-1-git-send-email-yangbo.lu@nxp.com> <1477625554-46700-6-git-send-email-yangbo.lu@nxp.com> Organization: NXP Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 50.171.225.118 X-SA-Exim-Mail-From: oss@buserror.net X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list * -15 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Subject: Re: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:57:07 +0000) X-SA-Exim-Scanned: Yes (on host.buserror.net) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 995 Lines: 33 On Fri, 2016-10-28 at 11:32 +0800, Yangbo Lu wrote: > + guts->regs = of_iomap(np, 0); > + if (!guts->regs) > + return -ENOMEM; > + > + /* Register soc device */ > + machine = of_flat_dt_get_machine_name(); > + if (machine) > + soc_dev_attr.machine = devm_kstrdup(dev, machine, > GFP_KERNEL); > + > + svr = fsl_guts_get_svr(); > + soc_die = fsl_soc_die_match(svr, fsl_soc_die); > + if (soc_die) { > + soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL, > +      "QorIQ %s", soc_die- > >die); > + } else { > + soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL, > "QorIQ"); > + } > + soc_dev_attr.soc_id = devm_kasprintf(dev, GFP_KERNEL, > +      "svr:0x%08x", svr); > + soc_dev_attr.revision = devm_kasprintf(dev, GFP_KERNEL, "%d.%d", > +        SVR_MAJ(svr), SVR_MIN(svr)); > + > + soc_dev = soc_device_register(&soc_dev_attr); > + if (IS_ERR(soc_dev)) > + return PTR_ERR(soc_dev); ioremap leaks on this error path.  Use devm_ioremap_resource(). -Scott