Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp227717ybt; Tue, 7 Jul 2020 21:23:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOt91P096fUzqbd6XdwCZG9T6Y4s9Ph+VZxbsDFIx4cRCMqm/4jS1MqazhlEu3BveqWLpp X-Received: by 2002:a05:6402:174e:: with SMTP id v14mr50459507edx.153.1594182182901; Tue, 07 Jul 2020 21:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594182182; cv=none; d=google.com; s=arc-20160816; b=P2C0TyhactdX/A6gMXlRsYUp1X9Ae0JRMIs0dvRcmUBLDVNDMtpyATdiY9NBXgpSO+ DAFb7tiP5WODa/Own702Xt2C1RmTavF4N2kj9b1ZbZGtUXsoVh56PzYJrJuitvtj7Rtk IPyHYpkvhJ2QDtXh9nLEfO58j4gXsJB5pUsqXdzQKaK8IDTp98Wy4X1IAS5F10M9XPxl t79of+dA5mhi0r7VYmSTTfCXqjscb8HEAOWgCJlkDoNbO5v1gVhJKvkG1SGcF7O3L1Na okNbpkeof1BB+ZK0M5GYtasBzmbfCPUS7M4ZeL6Wf2XLzzpVsqmw4nUj3dTKa6ZMskfo OIpQ== 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=egk+b4CpekAWqka2nnTyP0i/HLlHstZqWKBVVCAFgOw=; b=OrzLUzJu0eBqRlNc/Xo4Hv558Yl+4B0ArrmOSSLNatMjDeymsplF6QOZsoK2P/sPiV jWCBodvmBC3RfSwsG3KfJIR6sRVuXwDDroFL1UfvKi0ufThh3Sy3VDPl7LzOYvREsopT Jp6miH3dNczGJdctdpdZrTOiMh68LRTYBT3mGg129PpoyUUeIjgJI9x71PRf0uheyyJ+ ZT4Xf2T4+ygdYljJ+z+TcubmjgRqUEv1nR+iZ87mV9+7AVdsRhxTd81CXoSV+nDn/0dd QVgnrqCQQVgjtJO+8SnG0yIegkJ0qtLE2AevMFSqdwuwsvaxoGFbiE9NGnbNF38UizkF NGfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z8ED5p0w; 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 h13si16180063eji.459.2020.07.07.21.22.40; Tue, 07 Jul 2020 21:23:02 -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=Z8ED5p0w; 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 S1729614AbgGHEUw (ORCPT + 99 others); Wed, 8 Jul 2020 00:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbgGHEUw (ORCPT ); Wed, 8 Jul 2020 00:20:52 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF01BC061755; Tue, 7 Jul 2020 21:20:51 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id t6so21062631pgq.1; Tue, 07 Jul 2020 21:20:51 -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=egk+b4CpekAWqka2nnTyP0i/HLlHstZqWKBVVCAFgOw=; b=Z8ED5p0wPKOE2B9FZBZrGFuJ42CqwOXGrDF9EGZKa3dP6wBx6evE1eomArA4ipTfYj zVjMtoTf24ukjgsVT/DqSLU8fPZZu8AFURtosfCqn5u4Btu7KPTI9dLzAm3lZU7EfEA3 pacbPPtu17xs+txtYl2FTNxpc2hd9abpHYne03eqD4wiY3agMO188f3IvdPvdDNyZOVC i/SfaND2TLucgpejQCopHtxFRXRohQtSEiE2sy4TSbTABH7gzzyKGGmOTBZzoG/J6i4A zM2w7+1jx9q6aW5OWqW/NSlYel1wAgCunbds1jiGLAfZXV5GbyFm64wxDX1bK2D+XHMv zbPw== 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=egk+b4CpekAWqka2nnTyP0i/HLlHstZqWKBVVCAFgOw=; b=C/+etWUoX7aJpAC/ryocSud7NUMuFVnIdV+oL6PMxoYcKQO2FNYia9LOQlh4hTpjO9 Pv80FEfJH9dtfqGdMORb0UavtyMTKspSDE+FEQAL6oED5GUY4WrQ/KuNFJ6tM3yRtovq TduUPZORfpZqtX/qPl5pw6Ua96txo7il+eZqy7Eo745kdEwSghDK8tI1H4i/E/e5+Usn o69O0mJGZ6gQ6l2bZutjOWVIfshnqeNzBdcL4bea4V/t42p4K90bPlBmy76fRlh2Isjo WrdH8wAHsk7gkq3AyIASxij8D3RMl2kcUqassEyttBMJHOo2kAT2TWQuvLk5hcKSsRVa PLWQ== X-Gm-Message-State: AOAM530+BazsbJMppzxq5EoQd8OcqLFODPZ55qNCHP9dK3FAn9k03YSS 5fVJ0JYXBRBNxAKrQXY9cFkcZoqP X-Received: by 2002:aa7:9e5c:: with SMTP id z28mr39520244pfq.49.1594182051118; Tue, 07 Jul 2020 21:20:51 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 21:20:50 -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 17/17] tools: gpio: fix spurious close warning in gpio-event-mon Date: Wed, 8 Jul 2020 12:16:00 +0800 Message-Id: <20200708041600.768775-18-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/gpio-event-mon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/gpio/gpio-event-mon.c b/tools/gpio/gpio-event-mon.c index 30ed0e06f52a..1a303a81aeef 100644 --- a/tools/gpio/gpio-event-mon.c +++ b/tools/gpio/gpio-event-mon.c @@ -45,7 +45,7 @@ int monitor_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; } req.lineoffset = line; @@ -117,6 +117,7 @@ int monitor_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