From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C2B9C433DF for ; Tue, 23 Jun 2020 21:31:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70B6320707 for ; Tue, 23 Jun 2020 21:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592947866; bh=/44GbRVFyzkusa5BAVSVz2mQoKHA5iPo6BBEtM4Gp6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=abBf6QTkaX3IwxWLhickXYbywDxvH/bQ5QqHDqBg/GBti5CDkoBAH3jPlruGiWtUK 0a9SlCr4Vh3w3M/ik6aW5EpgBmGXOLWlDDaH6Syq+mWPEkKmv4RV7443HsUVi66kVu c/fXyQqRgfmNs6iQTUphGCZ26JMVldCgh48pB/mY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389248AbgFWVar (ORCPT ); Tue, 23 Jun 2020 17:30:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:55376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388395AbgFWUNU (ORCPT ); Tue, 23 Jun 2020 16:13:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1031E206C3; Tue, 23 Jun 2020 20:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592943199; bh=/44GbRVFyzkusa5BAVSVz2mQoKHA5iPo6BBEtM4Gp6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AODlnlh5/FQSDJkZcdniORC5tTXsOp5QfQyOGn2QuayqfjZhFd0w7hEnAoypXmewQ axjGtOFExPElglYWgcKQWjjucMXPSJHzogs6rsSfumKdY++QASFCXm4ht/ehfcAC2n v49UDpy6VR8UTGFHOx/g3ulAX9ua7mWfv1fW/Fzk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Chanwoo Choi , Sasha Levin Subject: [PATCH 5.7 297/477] extcon: adc-jack: Fix an error handling path in adc_jack_probe() Date: Tue, 23 Jun 2020 21:54:54 +0200 Message-Id: <20200623195421.591894072@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195407.572062007@linuxfoundation.org> References: <20200623195407.572062007@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christophe JAILLET [ Upstream commit bc84cff2c92ae5ccb2c37da73756e7174b1b430f ] In some error handling paths, a call to 'iio_channel_get()' is not balanced by a corresponding call to 'iio_channel_release()'. This can be achieved easily by using the devm_ variant of 'iio_channel_get()'. This has the extra benefit to simplify the remove function. Fixes: 19939860dcae ("extcon: adc_jack: adc-jack driver to support 3.5 pi or simliar devices") Signed-off-by: Christophe JAILLET Signed-off-by: Chanwoo Choi Signed-off-by: Sasha Levin --- drivers/extcon/extcon-adc-jack.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c index ad02dc6747a43..0317b614b6805 100644 --- a/drivers/extcon/extcon-adc-jack.c +++ b/drivers/extcon/extcon-adc-jack.c @@ -124,7 +124,7 @@ static int adc_jack_probe(struct platform_device *pdev) for (i = 0; data->adc_conditions[i].id != EXTCON_NONE; i++); data->num_conditions = i; - data->chan = iio_channel_get(&pdev->dev, pdata->consumer_channel); + data->chan = devm_iio_channel_get(&pdev->dev, pdata->consumer_channel); if (IS_ERR(data->chan)) return PTR_ERR(data->chan); @@ -164,7 +164,6 @@ static int adc_jack_remove(struct platform_device *pdev) free_irq(data->irq, data); cancel_work_sync(&data->handler.work); - iio_channel_release(data->chan); return 0; } -- 2.25.1