Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4876094pjb; Mon, 27 Jul 2020 07:22:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6DaOkG+TTMKGBee1S8Jbi9awz22XlEfoGJG//OmC20UBelvjw0gFKYUBhGD1YguJf7Joe X-Received: by 2002:a17:906:ce32:: with SMTP id sd18mr21819748ejb.228.1595859770650; Mon, 27 Jul 2020 07:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859770; cv=none; d=google.com; s=arc-20160816; b=ttsDA7Ja5CPlSLmsGUbA8LRc3nX0YxGUONzw1977YVlYW4GOnEwkn425ijLVtAG+MP PaxgNjNSwX1++rgC0skbUIcFxZNNnbmnPRoEWNyM3z/8fmlMqg00l5en2iEGWKUTcIbB Fyye62zd4idGVE4JRsoN42iQ3iqlLR5th/Z/X++kecVCM97lus+HEnEsMbw7fA03tMt8 YV5fdHRTcEzkAg1BGtOxOQt+LtM/VT+DMx02YY0cQwcw4j5BigoEb0D4vUblX3YHY2ER 08AWNzjntywdrC734z/PZjnMJIa9geLUYuYgJPqfwtV+B4Yylgdz5JnlyQoXUSYm4Cg/ UwqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uysT/wXhUnn5dOO0js8uJ/9/Jdn8WpDo1/KdaQkDs1w=; b=xp3AHxiJ4ykyd6U++4B9OqHl8yrJTZIrQwf97e+g9ZPeMUA/83IJcSkI5WdbFBaiYW s+9biPdPOXWFbgixWRU2bulCw/wGdmCYlo4DwECvpfr7TYhYNY0vQPbOSfZJ1UYlErIB U6geEyKf3TPia6tQxOvvoPP5N0in8tyETJMaoHAvNeVTpsdYJJ2Av3NRFEqTlAwsZGmo kkrldPRqD4Va9rMiWXp3r0jntLM0xlrL43klQWkftWj6Y0ZKM7RWQdeE2MSXwu2pWM9I 9Ew/AY8xmvgmWSGzItlZp6z1XksNuJwpKGiuKZGqZq6jTAbYiYKIDtVKAdrLbpNB/6LW urGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UhydlO4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si5443859ejt.487.2020.07.27.07.22.28; Mon, 27 Jul 2020 07:22:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UhydlO4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730772AbgG0OTR (ORCPT + 99 others); Mon, 27 Jul 2020 10:19:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:47148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730769AbgG0OTP (ORCPT ); Mon, 27 Jul 2020 10:19:15 -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 5577D2083E; Mon, 27 Jul 2020 14:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859554; bh=ePzMsZXUTslGkSsNhaVZcjTY3pwqZrmfziQBGeiOnbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UhydlO4sndCCvLScZd4JVgQHr74Hf6MV2zcDGcH2gp8KEyLq0Wqry55KndBaZfQg/ zVkbyUZa5ozgpFgQQAo1XCQXj11rlUocIdHhbLnZHqhxj1tl7RXaq0CiMIKfUpnAHu uURULHHYgZINZKwumtDc3qZWbzpy7goztn8LFt7M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Navid Emamdoost , Charles Keepax , Linus Walleij , Sasha Levin Subject: [PATCH 5.7 002/179] gpio: arizona: handle pm_runtime_get_sync failure case Date: Mon, 27 Jul 2020 16:02:57 +0200 Message-Id: <20200727134932.788426020@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Navid Emamdoost [ Upstream commit e6f390a834b56583e6fc0949822644ce92fbb107 ] 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 Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20200605025207.65719-1-navid.emamdoost@gmail.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpio-arizona.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c index 5640efe5e7504..7520a13b4c7ca 100644 --- a/drivers/gpio/gpio-arizona.c +++ b/drivers/gpio/gpio-arizona.c @@ -106,6 +106,7 @@ static int arizona_gpio_direction_out(struct gpio_chip *chip, ret = pm_runtime_get_sync(chip->parent); if (ret < 0) { dev_err(chip->parent, "Failed to resume: %d\n", ret); + pm_runtime_put(chip->parent); return ret; } } -- 2.25.1