Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1145041pxv; Fri, 9 Jul 2021 19:26:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfdV+RQtgZ5v735xXBs6VWxNLyLUjThDYUZUAh/cBNS5RRhDwmpOIhQjOf9EmC7p6xSW/r X-Received: by 2002:a50:cdcb:: with SMTP id h11mr51119694edj.366.1625883996065; Fri, 09 Jul 2021 19:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625883996; cv=none; d=google.com; s=arc-20160816; b=NTmNDeseDDHu/XO1tp9eherHchLwl5aDByMeiz96407/p6CyoSFAmFmnRVIAjA+MuE gTRNnMXJ+g4celg5GTH3k24jsddi626BGtaA87BqKYTFFvhWLYtAt275OIDB353xu7QJ TWuQubaaFv3AoC1name/AcsBXf3qz2LM8qQt0IXkUIenqODCzlga8sBPsLCqfj/y6Nvt HDw74bMGCITCR4cyyGhGqnzqndg1FU6oOdPh4XCIGC8d1L+UQYrRmtDbUyTrKDv7lM4X ISJ6YYb351MxY+HpxpMpvd6dqHCsj2d7FuV9tQcbONTD9JBycrQ4sDreDdQF1s2WdkTM b3OA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mNVZPa3ab6W/fPzJ9HUDfrC1mDNMMWg5im1yR2PSS2k=; b=Zx5kuvo1sKSqOfKvUpkPya/uLfSv2eBl1Q4BPPh/Us6i5p++PVUFHOWIyMABOi7V4j LAAfKH00lR1IZa45CR1xIZBidtPoOz9FCC0WUKWmhYThUAkuomV5Jvwxl/V6K8sxBD5T 0Y2xsNQPfmFPtGBoGuOXn2RRYs4+bio+P15O1YOqCGh4G7WMMXL9fVThzqzeO/qHC1Eq IRG7NaK7heN2oGw02juaKXZwhPn4pqS78VAlK7UeZcOFQ9UwDwrYIF2C5TCnX92Ubclc vMD0+Cav2m8VbL4360LHeCceC1VAV0iFLtuXQk/1uxQGa++LBUsEuG/qOety7UgZBs6R T33A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WL5U2MSt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si8985979ede.66.2021.07.09.19.26.13; Fri, 09 Jul 2021 19:26:36 -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=k20201202 header.b=WL5U2MSt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233452AbhGJC1Y (ORCPT + 99 others); Fri, 9 Jul 2021 22:27:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:42924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233455AbhGJC0H (ORCPT ); Fri, 9 Jul 2021 22:26:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3ECFF613FA; Sat, 10 Jul 2021 02:23:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883801; bh=ryTTaVA44sGuLatGbFmEcoxmJyTLZaMZkUGnrbDWVsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WL5U2MStGBSRYTyopcWXgxlDXkKBIpq9TH/2nv4Iuy3iSMEVmy0wMzPqknMUql5NI 6iFF8Pb+N1iFib/obJoeQG6w9GHezccYJuin/ITBltSfypltEHt9o859boMgTaJz6u giKqL9v5l8oH1GwhEcK5i17o/iUqsx43Vx2gxHzGnjQ16CqKFYVK/8Fgy98SVCPiOD DTcSPYVQKMEtwg//qp5vHib7xXeuPOnp9zHcIHk5c8fZ1v4BZjrqkO6FuoefXF9mBz dGIzNgSiup/DDNOudGlExG632nJSte0wCLgAlE3+Bq8J+f9QqXTt1YZIaP9cO2Nhtk qI+Tnplz8tPpA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivas Neeli , Bartosz Golaszewski , Sasha Levin , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.12 064/104] gpio: zynq: Check return value of pm_runtime_get_sync Date: Fri, 9 Jul 2021 22:21:16 -0400 Message-Id: <20210710022156.3168825-64-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Neeli [ Upstream commit a51b2fb94b04ab71e53a71b9fad03fa826941254 ] Return value of "pm_runtime_get_sync" API was neither captured nor checked. Fixed it by capturing the return value and then checking for any warning. Addresses-Coverity: "check_return" Signed-off-by: Srinivas Neeli Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpio-zynq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 3521c1dc3ac0..fb8684d70fe3 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -1001,8 +1001,11 @@ static int zynq_gpio_probe(struct platform_device *pdev) static int zynq_gpio_remove(struct platform_device *pdev) { struct zynq_gpio *gpio = platform_get_drvdata(pdev); + int ret; - pm_runtime_get_sync(&pdev->dev); + ret = pm_runtime_get_sync(&pdev->dev); + if (ret < 0) + dev_warn(&pdev->dev, "pm_runtime_get_sync() Failed\n"); gpiochip_remove(&gpio->chip); clk_disable_unprepare(gpio->clk); device_set_wakeup_capable(&pdev->dev, 0); -- 2.30.2