Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp227387ybt; Tue, 7 Jul 2020 21:22:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw211Ym+uh5qXrzAUNSZZfXs71l8JJkE39XaePzPJckHLTa8z4D+gW5QjD1hYIyS7LCc3LV X-Received: by 2002:a50:fd12:: with SMTP id i18mr66485432eds.371.1594182140477; Tue, 07 Jul 2020 21:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594182140; cv=none; d=google.com; s=arc-20160816; b=as97JnhOXKi3jVf2rN34VHhdz37wQ51Vg0Lo9AGjcivZo6IuFNHUSGJ9Je6OLkmYSo r8rmg2WiEgkurXgZokYb/ci5CxI7t3GbpTVlfpok/x9roYlTZ9st5SELAML8eRw6LqP/ 4BVAtH2Nd/1XQKjCKkEn5b+ezBrdqrS0hbZqgaUTD4QUjiLd4UK7IPR7WIYHLdNfhHh2 xSv5PsKflBr68Q9CdlD/S/QfrajIXzawY5oq9YRQmlq2CL1K6xQqQ4old1AM3QHugTpP YhGA1asH7GoLvJdiDSXrU5NucLsQgsRMW9i4izbqgsi9i04wJR4Wb2be6MgoCUq8aA0m Xj4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mVj4QaRFJwXQOHlJdSKbib6tPQMBpikDxG7+0rwvolA=; b=fGIj/E/XksKbJ5osqed/YC5XNgzqxxmpgVyHoQ4vMUoSjrbTqYWa6gLpStLToFcKF8 dTwUfMdFRx7p7bnVdZgieFnU1wNKj+gUovZGKkDCo6RXdCpls5JXGwiUVjb65+aUmg5Z hzKbfyfm6Pi0Dqe+c9kH/wmm1aAqpkVFo+XfZFJ6LlCy8NqSS8/CR596OitZoh+mFShM PMG97pW8b43uMFx8ak+sPHlMw4/rpx681W9s7km2x2N8OIfpkbt0qHmJKEG9U9gUpjhR AKD9rAXHwguhzm/pUFTU1EsXM6E9oQNaL9qMouW9mv/SS7xmcgGsmbEc+Kovb3cH0Xdy s08g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EE1U1yNh; 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 i20si16128254edy.277.2020.07.07.21.21.57; Tue, 07 Jul 2020 21:22:20 -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=EE1U1yNh; 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 S1729545AbgGHEUj (ORCPT + 99 others); Wed, 8 Jul 2020 00:20:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728234AbgGHEUj (ORCPT ); Wed, 8 Jul 2020 00:20:39 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D5FEC061755; Tue, 7 Jul 2020 21:20:39 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id g67so20145462pgc.8; Tue, 07 Jul 2020 21:20:39 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=mVj4QaRFJwXQOHlJdSKbib6tPQMBpikDxG7+0rwvolA=; b=EE1U1yNhhcYCS6KLQXJ0k6Z+EfWCmwq/wOP388r1k3FkJ9sDHSF2vbYHCxf51ToJuu agwOjcG24AZfqo/yRp8pNvgjxPxhHAYnxq7Z49jRuIKXHKs0hOQ0SPVIGQubjEdRfAD2 x9IeAavAaGBnR2sgfgxII2w5BKsr/fPNdQ4JBrE309J0I4gujj9G2jY4r4PbSYXZy8VE 2Wii6Q2uiqK0nYZ9wkhma5s9wuyKXzhmfqxUMvazda+9Mv3HbbjsjHcNiZLVdHaKpfkG J+7NVkO/p7dYcyV9AmeLmMXqPmOM6UequwPnFTTjeps/kh5JkjyiqQHMh415UZvUP/RH 1nsw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=mVj4QaRFJwXQOHlJdSKbib6tPQMBpikDxG7+0rwvolA=; b=BciBnjFbTutriJ0tHerUr4GEhZQMtSn5Cw0Ky0zlFO6AafTzjzC3JnS8zP0YogxQZn c1guNotjBRDWoeSEQqp1vfUuMeyCl50LMDUmSrcssnMvsGV4qpz8kws+m0t1PiamQ/X6 Nlmc+NtFYJoIJKCZEIm3me4dkWLdkWeYPPUZHg3M5l5Kr0JHBckYtcK4FTklCfIaIqmk nd/9QlD41PZD2pzb+PLGrmf4uZnhYJCEW8dRnQxYjxDNNSHotkbpsBEHOomCQ7l5eRaT 5VhRGjEcbuvgb0I2WiYWo+9uec2oGYYWHX5sXjtE6BZm7kpX4Z9byoom0Z6EyGSuKbSr 4Yxg== X-Gm-Message-State: AOAM530Q6hqPNrFt1oLCO7z7jNN928l0P78o6gVD3FtoRYVB52JC7yho yk1yWomK4NafszrcewiCXsA4UIe1 X-Received: by 2002:a63:405:: with SMTP id 5mr46148298pge.449.1594182038374; Tue, 07 Jul 2020 21:20:38 -0700 (PDT) Received: from sol.lan (106-69-191-222.dyn.iinet.net.au. [106.69.191.222]) by smtp.gmail.com with ESMTPSA id gx23sm3821951pjb.39.2020.07.07.21.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 21:20:37 -0700 (PDT) From: Kent Gibson To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, bgolaszewski@baylibre.com, linus.walleij@linaro.org Cc: Kent Gibson Subject: [PATCH 15/17] tools: gpio: fix spurious close warning in lsgpio Date: Wed, 8 Jul 2020 12:15:58 +0800 Message-Id: <20200708041600.768775-16-warthog618@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200708041600.768775-1-warthog618@gmail.com> References: <20200708041600.768775-1-warthog618@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix bogus close warning that occurs when opening the character device fails. Signed-off-by: Kent Gibson --- tools/gpio/lsgpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/gpio/lsgpio.c b/tools/gpio/lsgpio.c index 8a71ad36f83b..b08d7a5e779b 100644 --- a/tools/gpio/lsgpio.c +++ b/tools/gpio/lsgpio.c @@ -94,7 +94,7 @@ int list_device(const char *device_name) if (fd == -1) { ret = -errno; fprintf(stderr, "Failed to open %s\n", chrdev_name); - goto exit_close_error; + goto exit_free_name; } /* Inspect this GPIO chip */ @@ -141,6 +141,7 @@ int list_device(const char *device_name) exit_close_error: if (close(fd) == -1) perror("Failed to close GPIO character device file"); +exit_free_name: free(chrdev_name); return ret; } -- 2.27.0