Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1151385pxv; Fri, 9 Jul 2021 19:39:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAKt5hMb4WEnfMgFNS9VHFSMa9Jpo4pNArdQrDSGNRPfijSvEBJo+dFE/g+LPsQ+6qxwyp X-Received: by 2002:a92:660f:: with SMTP id a15mr30540875ilc.182.1625884791785; Fri, 09 Jul 2021 19:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884791; cv=none; d=google.com; s=arc-20160816; b=Ep9MyWCTynIYb0VeZGmWFisBmFYb0oZREBw4qhukUTGi2VpWWv9cqoPmzpVYjBFckJ H6NhkXbs29ofxCjKzUBjuODmjC+joP82LKqyUFMV8tGNMBIVOGhuHQJevbadpP6k16zj tNYaiPiQZov9H5A9sACKk3dvhPSoOk2kqrrLbqeTA0QeVfRr7vPuAF6QycuI3cbcUczu eBPCNRFpX47rkFbWlWdQQMbuPsPdDtAmG6zGSZkdo+JbrzM4wJwj3tnLxD2JqEiw/h64 k7Jlhkq+c0om1/hpgcRcbzIt1kk1wLiZ69FI+MXXTFKMN0zvcGJ5YSOvYzQlAchJ5wnk roEA== 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=OC7SE0PPz+IawO55XgBIukP3vd0k59XmM0lB8T0AKnY=; b=ADJVM7fcd3CuZk0r3ZNxjMtcsHCWimGy6YJjw2wMqLy/OXExk3Nv6RBzt18952ae/V YwaFcoNRGczn1cIXeiXj9J7RY26qsTjancda//IWf4yOBc0wupMe0VKeKbLlp3WsNGJt 9O9My7wUOfz0mWS36tVrIkU8RnNGthSLFCxbCcyixKlCzeE06G+oLEzxEP7rPWZk9eGK /oR82WqNt4hXax0L0j0grTgOjZQTJG2aWMcnDsOD8nVrGt2s/O1Dwiz4z9b+kkpUXlzI pM/D09DAHwynkWZOvK0iz3G9eh1P7fN+R+SShWLxgMeJU9wfMijtnttz52WP1NkZ7/MV bNgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=snJxFKex; 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 c6si8955525jab.33.2021.07.09.19.39.40; Fri, 09 Jul 2021 19:39:51 -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=snJxFKex; 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 S235403AbhGJCjX (ORCPT + 99 others); Fri, 9 Jul 2021 22:39:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:53536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234151AbhGJCfc (ORCPT ); Fri, 9 Jul 2021 22:35:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E8BA61414; Sat, 10 Jul 2021 02:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884353; bh=To1gUqapLgeZjXIKulL3uwXVhMqJs/4HoSOsGhsuboE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=snJxFKexuBL99uPvN7qv0OBzdNxMFVn9toqdbJmPkfHyxMu2EOQuMNvZXc8uLXT1j AOHueQ3gHyKEDGsvyB4Sh79RhvG/TqyndjwN2YOG2iYKZoDz5qEIESqnX469efkEga 2N43C5BeXnjmJjGqxTYmc2Zrz/5bQAsh6O1pwD7cUtvIWn9a1GEs6PX5tB+yehryHW Q6ZBneiiCl7j6mJQuvbl0Cx5gvAQA+tdYpOXFcxJl4C1oft3v0TWBbtD6SFW+Anvoa WqyZESGgslW42NfgEYhomdBaFVEX+uJ8gsaSPRVOtFxm7sCtomYJzSDA/AhqGzFhbL 7RHZP9Vlt+Gbw== 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 4.19 23/39] gpio: zynq: Check return value of pm_runtime_get_sync Date: Fri, 9 Jul 2021 22:31:48 -0400 Message-Id: <20210710023204.3171428-23-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710023204.3171428-1-sashal@kernel.org> References: <20210710023204.3171428-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 5dec96155814..c2279b28bcb9 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -919,8 +919,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