Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4449269ioa; Wed, 27 Apr 2022 04:14:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZmTeWkyuU7gLETvh+Vle5ixMW/fe/DswfdDPqHKRqPtXZg4wAdadjM/t+3fAN2wXc6g4r X-Received: by 2002:a63:80c8:0:b0:3c1:5213:acb5 with SMTP id j191-20020a6380c8000000b003c15213acb5mr1133057pgd.557.1651058072452; Wed, 27 Apr 2022 04:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651058072; cv=none; d=google.com; s=arc-20160816; b=zkpnCnyAyC3HAoiM7C3JWN7NaOyr3/VLoeFh2HtWczWx/aeaLAoUBeMhB7iSzWTghE 1Y3i/Gzfb9TL3j+LAIYcjTbS93SA+4z6Wa54NBQgLD7javAdjOGXZUtW5FBWY7z34dzK B8vOWdtwCZimraMPLKCNblZwP7o1IEWXKueiNp8Io3Cnhjq8TJ1YhW26OeJBPhuYGQIs 8kZmcu6rA00/XCodMbi6Uelmmhx3WTWucnaokapt281Tz95QLPg0Uth0jQumuOCy+oqO 4n2N4NmsmypEb8nMAVWquMBClmHx/N9XtHLVaNWr1hkAf13ckGkbybRnJ8cUgW09TpjZ 2Y0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=svkK3sjIuaeJLuuE94uoxLeqs4+iHazfg+p4LQReTKE=; b=sFX5TysAzUzhJRrbmqTjQ9+iG11HupiOxYEcbj+bcwunwZguPegFSlFpoJPG3LPScl pObhRoD7CCJtGVKgcr+BA1Va4XNHpqgZOkyWTdoH6a0ZR573dF79q3k6IiReXFQsW7WW ZftnMO10msqG9s1XlWSm9kaW23hwUHMVvppq7W+xzXxNLR76vVIVdlRKUDQiM/rfSCe/ nVK4xwAuv6l9sMXQpqy1wnseHcCs+6MTm5+K1p8hjWTRRvS/d818vAIhI/Gj68jnXTjU qQoJVk4FgXypUkYTiw2QeeRcG5y1u/lGy/0H/KYgF9WECJWKNAdEg4he7yFTlTSNnJhd ulJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Vqkn3rUZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u15-20020a056a00158f00b0050d8ac9c429si526672pfk.101.2022.04.27.04.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 04:14:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Vqkn3rUZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DF7892FF8C0; Wed, 27 Apr 2022 03:08:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245042AbiDZJVn (ORCPT + 99 others); Tue, 26 Apr 2022 05:21:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345651AbiDZI5l (ORCPT ); Tue, 26 Apr 2022 04:57:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A67976256; Tue, 26 Apr 2022 01:42:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 410BC60C49; Tue, 26 Apr 2022 08:42:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48747C385A4; Tue, 26 Apr 2022 08:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962529; bh=GWcUtf3UQVYWNlTxcZ+Z1ItyTx0lhByWckaw0QEi8uk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vqkn3rUZo+hcXXqWRT+XPSYA33iswCmRvRkBLQj1EiNlMjweecjBQogJXIP3ROlmG vqH2IlVmo5oabd3dWm2YVKnWiqsgkCsvmDjy97q5z1aMXgXhrPTFqTMZcvbsAsvZaJ +Q0tiTdnbQYkQUUaHFPBijt5P04cFI8UJmWytemQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Dmitry Torokhov , Sasha Levin Subject: [PATCH 5.15 087/124] Input: omap4-keypad - fix pm_runtime_get_sync() error checking Date: Tue, 26 Apr 2022 10:21:28 +0200 Message-Id: <20220426081749.773512486@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit 81022a170462d38ea10612cb67e8e2c529d58abe ] If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors. Fixes: f77621cc640a ("Input: omap-keypad - dynamically handle register offsets") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220412070131.19848-1-linmq006@gmail.com Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/keyboard/omap4-keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 43375b38ee59..8a7ce41b8c56 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -393,7 +393,7 @@ static int omap4_keypad_probe(struct platform_device *pdev) * revision register. */ error = pm_runtime_get_sync(dev); - if (error) { + if (error < 0) { dev_err(dev, "pm_runtime_get_sync() failed\n"); pm_runtime_put_noidle(dev); return error; -- 2.35.1