Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1143441pxv; Fri, 9 Jul 2021 19:22:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQAOArCvbFIYj6fAISSJ6X1R1nuTELiOHZ3K14GJwmdm9M5hpDKHywE3+P9mZ5gzFdupSS X-Received: by 2002:aa7:d98d:: with SMTP id u13mr7287360eds.238.1625883776560; Fri, 09 Jul 2021 19:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625883776; cv=none; d=google.com; s=arc-20160816; b=0j56IRwmzjX/uwbI91gMGEVtldSB5u2HOMNGgHTIwm/aXqLoeR2rnSXUVENcB1zjHj Oz9DqphdUUkMDtw+Sr7fugiKX6fR44gx76ZR4cyqWGCVgxiqh0PRQK75ZevWznlcCqBz NB+33aEeM64B0Md7QzPQWZcNMD40XlKLEBZ3pc2dw2gfwc9GQTGif5tMBEHXC9i4aFpg jfCKgxtT+vypC+z1ikVEz8+cqlNcv88zo5ZEcKZqrX/KR4gqX7DN7sssaXvBovtFGqcN jYN044QSz8MCwHluUgLOv+XlOnwmeXq6PbDcPnBYpcKNJvvONy0KPxtIKmP32aF69f1K QcGQ== 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=lhbXo2ZZIYJ4u3DtY1wo9ZPS88mPxMQAAYIfh9MfDJFixdup+6BfxaQ5tyhx7p1pqZ P4qcY8G/4358DO+N02dxBbnhZmQWtoDJG8wDBgWnUD8WkeiJATvw6vqHaUN2PB/v1lVV UJ7RliKp5QcmrTPUB+4ZZuLBV8DAyCpRnW3iOmZzU0xE8Co2bEKmGQoePgjEdiOx/t/y GSRoFbLpiAs6ddWmWB9tzktdurLFZA1rPlysDpY4+x8v23DiGJXI36fpEnwYLGSLqihq +0ZQFGTHckVIySI3O3TiQq2Ace2sUTcNbsWAq5suzeOLia5aR1FYF4WQjIoBP/noKSAI KWdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rSzN2L61; 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 u12si8519545edp.98.2021.07.09.19.22.32; Fri, 09 Jul 2021 19:22:56 -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=rSzN2L61; 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 S233240AbhGJCXe (ORCPT + 99 others); Fri, 9 Jul 2021 22:23:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:37724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232837AbhGJCWL (ORCPT ); Fri, 9 Jul 2021 22:22:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4BE6E613DF; Sat, 10 Jul 2021 02:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883563; bh=ryTTaVA44sGuLatGbFmEcoxmJyTLZaMZkUGnrbDWVsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rSzN2L611nOCWRhL1Uq7m12SvizO3LYgvzr6Ta0umSpJw8uoCVTDHKlE4bnzaQLYU 59ZrikDqqNUrAD9TyIfkFTpfpULh2JwkbP5L/3CldYwJqPqtIXeoBJXOxGjppMC9Z1 +aO3G5eRRhph3/ey/UrjJ6/WqL843DnMzgl9Z35QrW195rFvSxzdtbAfrvN70v4x5+ 3sOeV+rqXZ3iQaAGf3iUOqGYDJc1Mz2kDlgXCQ0Lkcz6+QxibS3VJJRUSMC+MJxhGh f+qmg5XYYtS42I5ne6ae74ORFhgT32PF7o4uUDAxzAhfitYrwjpFYphpfVn/kLdHC3 0gE8ddIXRwQAw== 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.13 070/114] gpio: zynq: Check return value of pm_runtime_get_sync Date: Fri, 9 Jul 2021 22:17:04 -0400 Message-Id: <20210710021748.3167666-70-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710021748.3167666-1-sashal@kernel.org> References: <20210710021748.3167666-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