Message ID | 20200921162033.881164155@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=lyed=C6=vger.kernel.org=stable-owner@kernel.org> 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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 285E1C43465 for <stable@archiver.kernel.org>; Mon, 21 Sep 2020 17:06:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D75202084C for <stable@archiver.kernel.org>; Mon, 21 Sep 2020 17:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707966; bh=UFPr6/llB4vS7xtdsNfY48Ig0GmN/EZmKOo7XcHpDbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Y8IiWJzC6F4eeIl2EiwStGzGmNYwsDC8I6kIgjC1524CxoMQYhEmTJZ2ml+JOfsEV cfpB43COJV5Zx2nKJUu3hv1V5zy7AdP1Fo5+wcDlsH5VOwoxyksyzG36vRXadioKkb UrHvvOzMkhOurKgrM1bNO6KL0Lm8jagqaXmBJv4g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728569AbgIURGF (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 21 Sep 2020 13:06:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:58970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728354AbgIUQdE (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 21 Sep 2020 12:33:04 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 63C6B2396F; Mon, 21 Sep 2020 16:33:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705983; bh=UFPr6/llB4vS7xtdsNfY48Ig0GmN/EZmKOo7XcHpDbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jexk5/KfxWvO9RUHHeSTpfKVuvaZW0zUeMh0O0zSee8s/xjE/CyP3YlIHdqJBgwAM sCR1Hw0RcIA14Yo4138Trg/9tO3bUb2lQOg/yRbJOgTnhQhDfgHmPVCgzVcUJjXWDz b9gvTTv2PCqu92cisb6L/GZ+EyfC4sDTJNUAOjLc= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Jonathan Cameron <jonathan.cameron@huawei.com>, Angelo Compagnucci <angelo.compagnucci@gmail.com>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 4.4 11/46] iio: adc: mcp3422: fix locking on error path Date: Mon, 21 Sep 2020 18:27:27 +0200 Message-Id: <20200921162033.881164155@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/drivers/iio/adc/mcp3422.c +++ b/drivers/iio/adc/mcp3422.c @@ -145,8 +145,10 @@ static int mcp3422_read_channel(struct m config &= ~MCP3422_PGA_MASK; config |= MCP3422_PGA_VALUE(adc->pga[req_channel]); ret = mcp3422_update_config(adc, config); - if (ret < 0) + if (ret < 0) { + mutex_unlock(&adc->lock); return ret; + } msleep(mcp3422_read_times[MCP3422_SAMPLE_RATE(adc->config)]); }