Received: by 10.213.65.68 with SMTP id h4csp889670imn; Tue, 27 Mar 2018 10:39:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx48msKlrddrktTB2RpkdTzbSSULqgad65e1sMpFwhyR1FRuWsqgbmf8Xz1KG7ocVfjxZxipM X-Received: by 10.101.100.203 with SMTP id t11mr156155pgv.129.1522172340416; Tue, 27 Mar 2018 10:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522172340; cv=none; d=google.com; s=arc-20160816; b=OAjXHr6Unh3hrxqx7PUyUWg5fBR8H6/mKOa37F6kxuy66/vGBqbRbM8lVkT5O6FWKB EamVyQdn7bEQgXTDjY8PRDiDtbziZsbVtlEEWUAL8FbYLNrPT3XLqqBkIWc6kHVUEYy+ XWmoXb/VQ4vVyMHV8SFDTkhRAHVj+HPZUs1kdhfjxHnXzra6a1Yt6TvNIqzqzL515rc9 LzswQk9aJy20Mjve+/3xbFXPt9cHsxfQwvgwzrzg4M0BBzTg0LyJB0iXGUvKAUCfd10D xZsQgxf0rBzeHArBv8fzFpIN6d7NeJoADESTKXc0jq23BDXU5aZ0+CqP78cpkB+DY8wk twog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QXtHyYuJEyXtc50t6lheLPuY5tk/rAY+icavo5ej5m0=; b=tJpd9FdQbgPtHSi2qo/KRM+hzoUAeiEzJsiJz+WpZgEYxSHG2eg94eOpUgb5L7vl/m xkk/LP/OhKh7fzqq1bGEnw17cJwVaZIfWKINmE9zy628xeEES6ILpd1/6y0fL+iNkJRb lnhbb8gXmP4BHtqkvkfB9pm3/Pzs/5mbcbDzVzxExCoYMa3ofYijOPd38b3JvHMLJKyc ZNmZrPgyzFvdRUQIQ3evRCdVDDLGXIk24lwheSVRLHec1PGz1uwnNP7XCidWFfcUeLLe tX7MGOp/+/VdAGfdTj9OveBGaAjikqvlZCF9gisnjb26gw+qrYM8vdrJ75KJRuEctY+N CVcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 128si1121205pgh.189.2018.03.27.10.38.46; Tue, 27 Mar 2018 10:39:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754562AbeC0RhR (ORCPT + 99 others); Tue, 27 Mar 2018 13:37:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44458 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754276AbeC0Qei (ORCPT ); Tue, 27 Mar 2018 12:34:38 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5AAC71226; Tue, 27 Mar 2018 16:34:37 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 4.14 008/101] iio: adc: meson-saradc: unlock on error in meson_sar_adc_lock() Date: Tue, 27 Mar 2018 18:26:40 +0200 Message-Id: <20180327162750.547377222@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162749.993880276@linuxfoundation.org> References: <20180327162749.993880276@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter commit 3c3e4b3a708a9d6451052e348981f37d2b3e92b0 upstream. The meson_sar_adc_lock() function is not supposed to hold the "indio_dev->mlock" on the error path. Fixes: 3adbf3427330 ("iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs") Signed-off-by: Dan Carpenter Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/meson_saradc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c @@ -462,8 +462,10 @@ static int meson_sar_adc_lock(struct iio regmap_read(priv->regmap, MESON_SAR_ADC_DELAY, &val); } while (val & MESON_SAR_ADC_DELAY_BL30_BUSY && timeout--); - if (timeout < 0) + if (timeout < 0) { + mutex_unlock(&indio_dev->mlock); return -ETIMEDOUT; + } } return 0;