From patchwork Wed May 29 17:09:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 2631841 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id AF525DFE76 for ; Wed, 29 May 2013 17:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932689Ab3E2RLM (ORCPT ); Wed, 29 May 2013 13:11:12 -0400 Received: from www.linutronix.de ([62.245.132.108]:57928 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759696Ab3E2RKD (ORCPT ); Wed, 29 May 2013 13:10:03 -0400 Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by Galois.linutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Uhjsw-0000T6-CW; Wed, 29 May 2013 19:10:02 +0200 From: Sebastian Andrzej Siewior To: linux-input@vger.kernel.org, linux-iio@vger.kernel.org Cc: sameo@linux.intel.com, jic23@cam.ac.uk, dmitry.torokhov@gmail.com, balbi@ti.com, Sebastian Andrzej Siewior Subject: [PATCH 1/5] drivers/iio: am335x_adc: cleanup on missing DT nodes Date: Wed, 29 May 2013 19:09:52 +0200 Message-Id: <1369847397-27451-2-git-send-email-bigeasy@linutronix.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1369847397-27451-1-git-send-email-bigeasy@linutronix.de> References: <1369847397-27451-1-git-send-email-bigeasy@linutronix.de> X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Currently we leak indio_dev() if the DT has no "adc" node in it. Signed-off-by: Sebastian Andrzej Siewior --- drivers/iio/adc/ti_am335x_adc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index d0317fc..b2f27de 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -208,8 +208,10 @@ static int tiadc_probe(struct platform_device *pdev) adc_dev->mfd_tscadc = tscadc_dev; node = of_get_child_by_name(node, "adc"); - if (!node) - return -EINVAL; + if (!node) { + err = -EINVAL; + goto err_free_device; + } err = of_property_read_u32(node, "ti,adc-channels", &val32); if (err < 0)