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=-11.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 5ABACC433E0 for ; Wed, 8 Jul 2020 07:21:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CDCD20760 for ; Wed, 8 Jul 2020 07:21:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594192912; bh=AlWh1K+4UB1dCOl88PhWodG1vGihddUyYMFznHgyj98=; h=Subject:To:From:Date:List-ID:From; b=N2KuZhdh4/o7Ly74ttF+aG0tgnFrel/+EqSg3KBGGeKOtw9rxjg7gqtrGZ5sHMBdB o/1spycCMNnOCvDy4qdWWhaI5Gr2MRIQAIRqWoUiCbmn40uUsc6k+N9cc1DfC4tMjQ q7phLQLOcuN+CGXjsWO3ujKG/T6nYtlDuSA0PwHY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730421AbgGHHVv (ORCPT ); Wed, 8 Jul 2020 03:21:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:45928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730211AbgGHHVv (ORCPT ); Wed, 8 Jul 2020 03:21:51 -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 5C655206E2; Wed, 8 Jul 2020 07:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594192910; bh=AlWh1K+4UB1dCOl88PhWodG1vGihddUyYMFznHgyj98=; h=Subject:To:From:Date:From; b=GiGENFeHbXCcO41sI+WptIVGCHtnfkToxbR4JU8imAafd48g+tMPJu3XiDqmjLE+r K4/m3TnBtTN3V7jQBqYhNnrqv4/cpxlNXNuEW+mXY2QpQjzyUS8wylqOlAzJ8QXVsp kZZ0XN7pkksEzTgw5j/1nzCJxAWnWy5bgFJ92CWM= Subject: patch "iio: pressure: zpa2326: handle pm_runtime_get_sync failure" added to staging-linus To: navid.emamdoost@gmail.com, Jonathan.Cameron@huawei.com, Stable@vger.kernel.org From: Date: Wed, 08 Jul 2020 09:21:30 +0200 Message-ID: <159419289019112@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled iio: pressure: zpa2326: handle pm_runtime_get_sync failure to my staging git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git in the staging-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From d88de040e1df38414fc1e4380be9d0e997ab4d58 Mon Sep 17 00:00:00 2001 From: Navid Emamdoost Date: Thu, 4 Jun 2020 21:44:44 -0500 Subject: iio: pressure: zpa2326: handle pm_runtime_get_sync failure Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost Fixes: 03b262f2bbf4 ("iio:pressure: initial zpa2326 barometer support") Cc: Signed-off-by: Jonathan Cameron --- drivers/iio/pressure/zpa2326.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c index 37fe851f89af..799a8dc3e248 100644 --- a/drivers/iio/pressure/zpa2326.c +++ b/drivers/iio/pressure/zpa2326.c @@ -665,8 +665,10 @@ static int zpa2326_resume(const struct iio_dev *indio_dev) int err; err = pm_runtime_get_sync(indio_dev->dev.parent); - if (err < 0) + if (err < 0) { + pm_runtime_put(indio_dev->dev.parent); return err; + } if (err > 0) { /* -- 2.27.0