Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1794826ybg; Thu, 4 Jun 2020 20:28:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMC/kWkOV3TYDNtQv2XeshPra5pK8HGo8S9cs+BKQ7MXrh836Wu0qrL6Tsk5ZvIdLx4hJa X-Received: by 2002:a17:906:924c:: with SMTP id c12mr7207662ejx.457.1591327712765; Thu, 04 Jun 2020 20:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591327712; cv=none; d=google.com; s=arc-20160816; b=nYGefKKV/rQAMNg6aA7Bw17zYeQgmOX2Iqm8DPYIOm+9Emddlg/vv/BIKh5UWGOKV+ Lwl6ZnFFSA/h43mCvbIjdrx6cXS5NzDVrlUB20VRly7m2luDQgkJVNHCoaBZtMZpuQKC DwXBrMuRBF49Jo7wHPBr9PkyqJmTlzYmpDW16ZUWoxcMmgIzLdS62JHAaEtcdjOjaW6B W8ofnjI11zRBa2I6iDpj9NDM4T1FiBJc7XVGe9sSAKeo/Xxgach55NDuz7nx85FXLlMi QRfVelbe7VZ2sof52J3B6HE9odt4jSpCB03t3l8LQVb9nxdWUmH8s8DGmS+JKY7nsqYm /gFA== 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=Wso3Uq4ZK5HIlYrGw+m1OLsKrcnMVzQIdIiN1bfsOnU=; b=TPYiGFw4KGbMfqMzrjEfR7pl+Q1XsH/evCzyNhcOECpFU6On+ovXnLfX0ifAbZ/Qak Z1u+jDKpsTK3xaFPHrdIjxAeosppV6z+snDv+uw3vkAdGwA9vUS4ROkqgWTcvKWOb5Q3 raq8/QR8LUP6bE95X6z9cJCK20ZhnZrUeMkse33T9V6NehbUmvvHjhfQoHFHvaALJzpf q8bIHb9KwFo0rRkKI72DT02U9BZOejdG3B9ikBNC33Qag/Vi7/+WmjoTHiclvCEycNW+ /Y3HVyMkkHKJvlT4FIn1V4yjDzu+ocfj+i9b8fbKuUJ56WgmsewraLteiuh4mWI6LrKc lNKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jpm0Bkg5; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 h7si2790836edt.259.2020.06.04.20.27.53; Thu, 04 Jun 2020 20:28:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=jpm0Bkg5; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S1726364AbgFED1l (ORCPT + 99 others); Thu, 4 Jun 2020 23:27:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726072AbgFED1k (ORCPT ); Thu, 4 Jun 2020 23:27:40 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADADEC08C5C0; Thu, 4 Jun 2020 20:27:40 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id p5so8202218ile.6; Thu, 04 Jun 2020 20:27:40 -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=Wso3Uq4ZK5HIlYrGw+m1OLsKrcnMVzQIdIiN1bfsOnU=; b=jpm0Bkg5ZInuslfAoRflVOENbBUZ5F2G1M+QXSVgKRgP7zXhR2ZLd3rjA+I+ZF8Bfa XFS6r9BwWoY1xOACIwhP47GjjjZ5M+06YSxHTh7gZ8MX38MwhZKyHpZxius1xBPEUKGa OueeNzSZTmrtmQ3s6+kvZ5+pQvjKMjgciWNb5KpFW73lYc+ATx+cvIywu2tJpcG5DN8i 5oxFTFQHXnDYNUpvbVQo5r5o1YVOiP7VjTu4zL7fhorJI15WCULvw1abhktLc4u/eFM9 6Fmk3wEwsN5V97/PHFgnrC3Ieut5TmJxIPLCi2ggyM785/pvnYTBNYgpPeM7G2G/nUHZ I9Ng== 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=Wso3Uq4ZK5HIlYrGw+m1OLsKrcnMVzQIdIiN1bfsOnU=; b=R0+Hd1l0i4JL2PrD4SHr3Gd457czURZUuBLL5wFy+E83bPU2mdSMLidJMx6FusU5wc 9UxyBzYBBa9jw90U8y5QcnC+asK5LQmK573wRJtrOktEpZ1TvT8agF2q62yCdWgo6BLl pB/o8hENl4XgShIIE6dy+mfp8Jdp6enqXuu0PQ2bYJUw6jP7fCn9qDfM5DlB2nWcPlLZ V3iaKv44Xj55ojvQNAqQOS3b4U/MyzkHCcBp18+fap9QkVf2GUHFrAA4v14DpKp7Svr/ oS3GuOh0k8grgngYsv8sYqdaTHArndR2lMG7TgqrBjnjF/bFHWPiUpXFyhidf144/jKZ eSSA== X-Gm-Message-State: AOAM531lmN0iQ61eAa/DZph1nUXeXNHB6FvTW03MKGmUtC+oITXlZQaQ CINhUB7LwIowvKSR8PLpSSU= X-Received: by 2002:a92:a112:: with SMTP id v18mr6320491ili.278.1591327659958; Thu, 04 Jun 2020 20:27:39 -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 v3sm2287930ilh.53.2020.06.04.20.27.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 20:27:39 -0700 (PDT) From: Navid Emamdoost To: Kalle Valo , "David S. Miller" , Johannes Berg , Thomas Gleixner , Greg Kroah-Hartman , Hari Nagalla , "Jason A. Donenfeld" , Emmanuel Grumbach , Maital Hahn , Fuqian Huang , Tony Lindgren , Navid Emamdoost , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: emamd001@umn.edu, wu000273@umn.edu, kjlu@umn.edu, smccaman@umn.edu Subject: [PATCH] wlcore: mesh: handle failure case of pm_runtime_get_sync Date: Thu, 4 Jun 2020 22:27:31 -0500 Message-Id: <20200605032733.49846-1-navid.emamdoost@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost --- drivers/net/wireless/ti/wlcore/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index f140f7d7f553..c7e4f5a80b9e 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -3662,8 +3662,10 @@ void wlcore_regdomain_config(struct wl1271 *wl) goto out; ret = pm_runtime_get_sync(wl->dev); - if (ret < 0) + if (ret < 0) { + pm_runtime_put_autosuspend(wl->dev); goto out; + } ret = wlcore_cmd_regdomain_config_locked(wl); if (ret < 0) { -- 2.17.1