From patchwork Wed Aug 8 21:27:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10602 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 31D1923E57 for ; Wed, 8 Aug 2012 21:28:16 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 00A09A1891B for ; Wed, 8 Aug 2012 21:28:15 +0000 (UTC) Received: by yenq6 with SMTP id q6so1333068yen.11 for ; Wed, 08 Aug 2012 14:28:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=rT7rSRM2ubdBNelD/VEpIh6f64nVUjJT0Mbitj/ajzc=; b=Dd4dwfaOFx/PTnvMgVyIGRSr3VhicDL7ZItINpGxb99mQNL4iijIrTBMEtiTGrMw+R Dtb3EB+n5YAR/T8EbcqSVWbvGA7Lo+YtBFGdEdsrvxluIZIDeq4kGBjTo8nWpB89agpV 5AAPr0XMsnl2KsLpGOsDeMlqHadpSk8qAABeuUOz4nwAmwvTkfZOli2Cxfc/1+QTQU0m ofq+soamxLc5Ov8Y7QMBVs8obRts8tzYD9r7c0FdJ5DC0din5DfeeApAiLH+Q0VhFmjW ifztd/ZWhOcLS/pYT/5KGE/nKUoSzGJAMW5HTAqy2LxmHexp4uQTQrhXfM4RJiDpwIkH qfjA== Received: by 10.50.181.136 with SMTP id dw8mr341183igc.31.1344461295238; Wed, 08 Aug 2012 14:28:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp628835igc; Wed, 8 Aug 2012 14:28:14 -0700 (PDT) Received: by 10.216.29.10 with SMTP id h10mr10236992wea.126.1344461293625; Wed, 08 Aug 2012 14:28:13 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.10]) by mx.google.com with ESMTP id h9si9277018wiy.44.2012.08.08.14.28.13; Wed, 08 Aug 2012 14:28:13 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.10; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from localhost.localdomain (HSI-KBW-149-172-5-253.hsi13.kabel-badenwuerttemberg.de [149.172.5.253]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0McRym-1TGkeK20Ho-00HwWj; Wed, 08 Aug 2012 23:28:12 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: arm@kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Bryan Wu , Magnus Damm Subject: [PATCH 10/10] leds: renesas: fix error handling Date: Wed, 8 Aug 2012 23:27:58 +0200 Message-Id: <1344461278-28245-11-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1344461278-28245-1-git-send-email-arnd@arndb.de> References: <1344461278-28245-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:hvY4z4/xOwgaWQ46rzB4M5c4tk704IPNMqqJ68+eJgh +qtdefototO85SwJJeZZfZcwRSgIvySgOQC7o4JYaJKsZwPQ3t TcxEX4KWq3c/sYl9dcvHuvjTI7Rfh2COLlmJtxzUuHET96yErV ghT0N2rv+V6q6wvRXhmziuBBhWfbL1PoOBoHvdSjwKka74lcW8 8wLFjgeI2lLhX9LO+TbQlXoQCbEAr3RHiweVo2uB4qIcvlkfKx P3eDM7L560+XjiC2L8w9zpjC7p+w9jzF589mEA/RlECewKf5+q M011trnYOgUkOnSmTOJw9lPyAT7kPFw8MottF6kmnGDDSXAezi qdTykJnMXMn4PZHXcmRw7w36Bo4HM9/Zca/KPt9nSVwzBs6eIt vIb16MvYjpYtQ== X-Gm-Message-State: ALoCoQmnm1GU+/OIqNpNXOazOPic9K4ZR7AeG/M62yO+J2rtyr/WAYQ5VOJCjF0hIZtdikctUBTC bfe4c041 "leds: convert Renesas TPU LED driver to devm_kzalloc() and cleanup error exit path" introduced a possible case in which r_tpu_probe calls iounmap on a wild pointer. This changes the one case that was missed in the same way as the other error paths. Without this patch, building kota2_defconfig results in: drivers/leds/leds-renesas-tpu.c: In function 'r_tpu_probe': drivers/leds/leds-renesas-tpu.c:246:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized] drivers/leds/leds-renesas-tpu.c:308:17: warning: 'p' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Arnd Bergmann Cc: Bryan Wu Cc: Magnus Damm --- a/drivers/leds/leds-renesas-tpu.c +++ b/drivers/leds/leds-renesas-tpu.c @@ -247,7 +247,7 @@ static int __devinit r_tpu_probe(struct platform_device *pdev) if (!cfg) { dev_err(&pdev->dev, "missing platform data\n"); - goto err0; + return -ENODEV; } p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL); --- drivers/leds/leds-renesas-tpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-renesas-tpu.c b/drivers/leds/leds-renesas-tpu.c index 9ee12c2..771ea06 100644 --- a/drivers/leds/leds-renesas-tpu.c +++ b/drivers/leds/leds-renesas-tpu.c @@ -247,7 +247,7 @@ static int __devinit r_tpu_probe(struct platform_device *pdev) if (!cfg) { dev_err(&pdev->dev, "missing platform data\n"); - goto err0; + return -ENODEV; } p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);