Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1147745pxv; Fri, 9 Jul 2021 19:32:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgRyxwTRF65SQ0U8S+w5eZ5zjYPXgeY2/DDfshsV0NfJj2AL2iURBFvHmbsFrGUxwQmSs5 X-Received: by 2002:a17:906:3555:: with SMTP id s21mr21462131eja.394.1625884326699; Fri, 09 Jul 2021 19:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884326; cv=none; d=google.com; s=arc-20160816; b=DT9tDf5srmcUG+6hsJ9AV2/T+01W1DLi/u8BNDzLqxxPa/ROz/uKTXQKEGMV4sI3ip cx9a6V0XzmM2490x8dbyq3YERFZ6bWQz0NTNhlyBT3eZTSyUJK8RaZ6ShoorXq+gvAey +pakvnYP0JuBSe1S1ilN84AroVUePnygnP58gKirwKvqHfdUlodB8o+f2RnCy47DMQO3 4wLnFeIEJmYLFPtIJi0kA+GbGo4I45dCYPHT241iHkrayWsgSPMaICOcj4brLCk6/T53 BmGF5d4Z1JlMTQeuQCvHHjZlDWbf/BNH8tAzCia2Vl0LF2MbLGC/vtkIKX601IcGXW5g 5mAg== 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=rqDlMc6f5SGdhmLxcEaTjK5SpiQcZ8rdPPRh6opAjXuIB2cRli13IPlf6+zjbJ9LJx RQS8ITtBbfiPsQZ88y9HdNfcGVFBohdT1Vld6Ef1y1yVhm9yDqZlz0OeTjVK3HNs9IsK BLISh8G1dUwmD2A7eaL0pojQpZy5L/YXCwHSpz9GU0bE9OhqQ6YvRiWdK9dLqScQAo6S nQAAq50JycKn0iXefABOSwu1Z/rJCBkYFez+tTjD69paNcZPzovWTFuKhXxnFVM+MUKe jJy/nIK9jPOi3J5nMnLIhh9P+KczZ2ZRwQ+kWQfBpdcxVAKt2KP/mVplg8eEtgzjrU5v FJTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bCMQSpbK; 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 js4si7849560ejc.580.2021.07.09.19.31.43; Fri, 09 Jul 2021 19:32:06 -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=bCMQSpbK; 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 S233876AbhGJCdb (ORCPT + 99 others); Fri, 9 Jul 2021 22:33:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:42882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234318AbhGJC3W (ORCPT ); Fri, 9 Jul 2021 22:29:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F1C061419; Sat, 10 Jul 2021 02:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883946; bh=ryTTaVA44sGuLatGbFmEcoxmJyTLZaMZkUGnrbDWVsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bCMQSpbKGPDE0Qd7nMh+MB6aFoxO4WoJhCUpXYz4nFkK+n+RHlwyd7IOdXkGdBrMI 5kQ7t+xmf2yAPm3e0FPvrqTLfTu86DkGdbH0KxBdm2euvm+ir+uxro7Pd7RGvePzYN RzYTVXSJxZZ17+R8wwEV2vX3MtZbh1uxeUoF2Z1oS27judiiYg6EESkLnhrf6CK1+Q XFMBOidRY/I9ymir+ONaG8hUpW50ZGkhFsIMGhoyee59zRM1/9/ttcizq67/FEvX5Q 0dZC+2HsjlUoS9Tpuki4Ybvt8fLN03MLO7rztTE7Jy1t6A44ueonYtJvgsEyPSinpK cc+Hv3hPqnhKw== 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.10 59/93] gpio: zynq: Check return value of pm_runtime_get_sync Date: Fri, 9 Jul 2021 22:23:53 -0400 Message-Id: <20210710022428.3169839-59-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022428.3169839-1-sashal@kernel.org> References: <20210710022428.3169839-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