Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1933385ima; Thu, 25 Oct 2018 07:14:06 -0700 (PDT) X-Google-Smtp-Source: AJdET5fCXMCwUCAWAvHqVdcz8Y5eEFdDPXpl4Ws3RCfiz6vfzF1XMDy9T7qsxwIM192YyD1kulyF X-Received: by 2002:a17:902:9a07:: with SMTP id v7-v6mr1665011plp.14.1540476846151; Thu, 25 Oct 2018 07:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540476846; cv=none; d=google.com; s=arc-20160816; b=vqql7FvHkC8JAiUFFkTzJWXNcvUgRvhNotkerNL3qh9sJHqYROjsSmFDf948u+xSTG sRmqtX3dxxeSwIQdhVALIwdBvr13Ew9yADjp7Firsmj7lYX/FpVBrWW28c8Nh45HDxE1 4NtFG/lEIgBEh6ExAWOb/r/mn6YTNnXfikqH5myng7L9+Hv/USKmO6UvTHrNhDphV6HV co8NERraiR16K5qvQxXPQuzhWySbDTKYzxNrsJ4BfQ11ia/mN8apxSXk+rXBwsOP4Zih 2d9dfECF5pqAOJXTBDEoHGRItmpGBfqpZ/uJxA5xW+mFqLg99KFiaJgY9uBwUc0WRs7M bwuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=MnUgFgLu2bN3+/WN9jJcYPQklIp0y1h/a2Y7Hx26NoE=; b=kDe4zs3l6uZu5luAq408NrsrW2qj3tAEK0zWfiPD5bj2GxAKdUfPKsy5ecpqHGQ8Fp Y/sIYQJ59wJ0fmmUdofErrVeCbcpi22b5Iu1dF7GSbWO5KBwSKjwKreSs+8v+TIL1O43 +FlM0jDG9eKqi+cykUGgi8aCnwtWtekIp3UU3DLic/MJWiiO5Adfna1qKV4chDdhE7Fp 2gjSR4kfOIpfHYWGGPwJO27TmWpsSCrwkt135+EQc3H05R7k1bxunXxTpf0oDMjYu9Zp 6k/TzFx2/kDCrNCCrllSRqn9KQkNKLSHDV/MWft3Kwipsak5SKJQe9d/TAqAejtMl4ck XsjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xW2zWlf2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id z16-v6si7897882pgu.525.2018.10.25.07.13.16; Thu, 25 Oct 2018 07:14:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xW2zWlf2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728407AbeJYWot (ORCPT + 99 others); Thu, 25 Oct 2018 18:44:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:53846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727497AbeJYWor (ORCPT ); Thu, 25 Oct 2018 18:44:47 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 29DB020848; Thu, 25 Oct 2018 14:11:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476712; bh=ikPRD1fkHakiAN3lZIv6ebEw/fOaiZc24mzkwyDfWHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xW2zWlf2YWReTU1ClnUGkufpTcL6X3ptF8D3iMy+2MecZ7GhcM1RyR+Cf3ndc8PTW 44vf02xnStvbncJwiK6dKnIDwS8LYBxK3UIO2r43xcIx3AvvSSdk2sLusxrYQuRyG7 GDb7p2tjWJBVKaPKAtPUdIXLFLmYNG+PFLkZUPXw= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Florian Fainelli , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.14 41/46] net: phy: phylink: Don't release NULL GPIO Date: Thu, 25 Oct 2018 10:10:48 -0400 Message-Id: <20181025141053.213330-41-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141053.213330-1-sashal@kernel.org> References: <20181025141053.213330-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Fainelli [ Upstream commit 3bcd47726c3b744fd08781795cca905cc59a1382 ] If CONFIG_GPIOLIB is disabled, gpiod_put() becomes a stub that produces a warning, this helped identify that we could be attempting to release a NULL pl->link_gpio GPIO descriptor, so guard against that. Fixes: daab3349ad1a ("net: phy: phylink: Release link GPIO") Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/phylink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index e4a6ed88b9cf..79f28b9186c6 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -561,7 +561,7 @@ void phylink_destroy(struct phylink *pl) { if (pl->sfp_bus) sfp_unregister_upstream(pl->sfp_bus); - if (!IS_ERR(pl->link_gpio)) + if (!IS_ERR_OR_NULL(pl->link_gpio)) gpiod_put(pl->link_gpio); cancel_work_sync(&pl->resolve); -- 2.17.1