Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1019441ybg; Mon, 1 Jun 2020 22:22:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrB/JgmP59uXP0qPgVSqz5ZlrM4+19Fys9yaHFFBSmyuHEEl10tFpv05QaZOGt6D0rdu6I X-Received: by 2002:a17:907:20cf:: with SMTP id qq15mr15908908ejb.238.1591075344515; Mon, 01 Jun 2020 22:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591075344; cv=none; d=google.com; s=arc-20160816; b=ugOZbXU7F2qKQvbRfh2LDKetNLQStZbBOLNyhZyqYlyuCDP7YkC+UXm+HQ7qfhZE35 kcPVOkvH4oX0Y8P+t2/Sy/onQaYgNWtKczH5ug2+8KkEXVWXdVV0bG37KL78qvQn7wEy qO0r5DAWPl5ClzmLHYu25W9qZ52y8OafleThfsgXY1wX0k07my8eIt7IvYm6T2OPGNSM dZYlEXXpLGIrNgVzBrLSh9LYcS74OeTBNLWepQPygWAnTzP/R2RTDIWdaV1sjHyuXmtx bx6O+XXftVQAdwST7oEH50EqdLZh9XxQYTpe1nPAWFPgtaUynXxFSpZbkbQR770J5bMW oBUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=F4Tq/P229PMR7ICasmIK23jJ97RLivCGIKmExPog8G8=; b=AX9LpiM1pzl04V6cWih35LVCMXKQQgBbukLjd2XGpRbVUtoMk2okVHwZq2iMlULW7k m9K5s6gwWp6McFrbIlPaJSAyVvXmn0R3cKc5lyLsinXKaVLUgCP3WbdGyaWtT6Z8fb4b bXS4a2wojbgnKjIl6N1fMudacy1H4LgAEgxJlrFaWCGs1gkY/7tZmjiPN27rfs1pqR2n 4LqBzeuVbS0YhH8Es9xAZerXqOyOtD0oMqweJCDE2dPpl+S4s7uKFTMluIP8dTAB0SzN GJ6OzrSftgC+0/LHRp/orzx2Lsz3iJ+0Y8QGvMkY5m715cmVS0FPLm+I2lT8KiD6KK0G HjVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=T8+hpTbn; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si870331ejb.670.2020.06.01.22.22.01; Mon, 01 Jun 2020 22:22:24 -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=@gmail.com header.s=20161025 header.b=T8+hpTbn; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725919AbgFBFUH (ORCPT + 99 others); Tue, 2 Jun 2020 01:20:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbgFBFUH (ORCPT ); Tue, 2 Jun 2020 01:20:07 -0400 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1492CC061A0E; Mon, 1 Jun 2020 22:20:07 -0700 (PDT) Received: by mail-il1-x142.google.com with SMTP id 18so11665388iln.9; Mon, 01 Jun 2020 22:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=F4Tq/P229PMR7ICasmIK23jJ97RLivCGIKmExPog8G8=; b=T8+hpTbnuvSHhwogA66y50kRHFMgbqBWsImhpLCQOsec2eMLbMFYMHQKbpbFo7W8h/ ROG3G+Z0+ElDX9XEMFtxd4xvH0wAgnn/u58FKPq3e9sq1q67YGHzWIUe7dtbHqbcELEX Yy0WVPyxMbgD9/9FYjHDryYFJv3dNRK9bhN9gkUYzXIHL9bCO6Eku0t2t9ORyAVhSaJR aXiUdn9GHjH1+hql2azDyb9KqcfYnVReFIj3PBiYdr96OuOx1xcbvz+O9xbGZnmXHIu3 eBHS38waTgPZHclVFlsAKP45hcH7KVJzx6xTnpALE0ov4+RllVphkCUqbD42iTguy3mB sXbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=F4Tq/P229PMR7ICasmIK23jJ97RLivCGIKmExPog8G8=; b=SKzgK/iDN4woiDk7PxE+lOyAS9w0x9SSRZSLAl2b/YqFfSWmZRZCo7dlbqpO+Wp7Y5 f/aO4zkWHUarNB+DJRwfrBx4M43tpBWKcdV9mDF7saP2r9IkeKwzie2fH3ENNY4dXLNW ZFOURRLzd3hJR234BoZ05UsiCKTT/W5Qll2JmeRKqj8uie3R3NaDvlhJd51pvHQfdZXs Gur67CZqPec+HHZjGzYqrF4AtC7Uzs1A/f99QdvOgTmuegNsV252hcqYhSH0RkE37FtG 7xwpn3d1BjSBJegakhX5LkXH1Fyypgh2LToV8twP6TewHDcc9bEzNu/VyuS8KluAEiz5 VHFA== X-Gm-Message-State: AOAM532Z/7PFUyuzHmbqRd0fckZ54edp2VsaKR9wa+mGGfgRMqyQkjfO A6ndT3e3Q+dvAIcBYyzYeuo= X-Received: by 2002:a92:8b0a:: with SMTP id i10mr23343495ild.245.1591075205568; Mon, 01 Jun 2020 22:20:05 -0700 (PDT) Received: from cs-u-kase.dtc.umn.edu (cs-u-kase.cs.umn.edu. [160.94.64.2]) by smtp.googlemail.com with ESMTPSA id z4sm882199ilm.72.2020.06.01.22.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 22:20:05 -0700 (PDT) From: Navid Emamdoost To: Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: emamd001@umn.edu, wu000273@umn.edu, kjlu@umn.edu, smccaman@umn.edu, Navid Emamdoost Subject: [PATCH] spi: sprd: call pm_runtime_put if pm_runtime_get_sync fails Date: Tue, 2 Jun 2020 00:19:58 -0500 Message-Id: <20200602051959.60440-1-navid.emamdoost@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Call to pm_runtime_get_sync increments counter even in case of failure leading to incorrect ref count. Call pm_runtime_put_noidle if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/spi/spi-sprd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-sprd.c b/drivers/spi/spi-sprd.c index 6678f1cbc566..860032af4b98 100644 --- a/drivers/spi/spi-sprd.c +++ b/drivers/spi/spi-sprd.c @@ -1018,6 +1018,7 @@ static int sprd_spi_remove(struct platform_device *pdev) ret = pm_runtime_get_sync(ss->dev); if (ret < 0) { dev_err(ss->dev, "failed to resume SPI controller\n"); + pm_runtime_put_noidle(&pdev->dev); return ret; } -- 2.17.1