Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp228400ybt; Tue, 7 Jul 2020 21:24:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgsuEQJ8ekWCAbhiANlRfWcEedEN6xykhm65isxsX7RPnqdtbObQMexdIgW3B2eRz7oqx9 X-Received: by 2002:a17:906:6897:: with SMTP id n23mr48458754ejr.473.1594182266096; Tue, 07 Jul 2020 21:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594182266; cv=none; d=google.com; s=arc-20160816; b=mHdC8MqyRqK3/lNcaEuJgk3Cxw9m0v9JMG12v4FpTmxYD36uRj/zkg4TsU3jxxKJOh QZEFpyf4Frw/KmGPoEmeiZO9crOfb0vgOl6Wn1ez1ifXzwVhSMQghSI3jeD/yqdF1GO1 AyZcZGD5yjvzF77pCczE/EPzJP+qfky1D0lsVe5Jklap1gZsjmvlM+wvMD5vV2YpJoQ7 bk4P6FfhtdWaHkm1tRhTzR+kGqid79ULpqME3OEZ/lnUDgqBPDczNnFogfCbBucajiZo DNPp7ab88bhfPZGLzu3nwNzXpFN8Nb5gD40VhE+UlmHzZjXuJ7T4cuccFbOSAw3MYb0Q q1PQ== 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=Jwf9HX2v4pIKa2lTAdU6rNePQ32bNm3wIaZRAoDNPmQ=; b=Y+5x5VI+8Tl5xwkKWbZYM5APoXRvqVhSiQxpHecvKZUom47FUH6z41+X5wSfv4CSLL EcxkJxttrFncaZng+ven7HRjvDFp9AW6yTtYTUyoRnjz6YGSsMnGMoiOggFhe0sFMqqJ k5U+Juwjnc3YMiS9uFqGKh8gq7demWjDWnniXOpF3MlhOmCboe1d694mkO+rhgPfZTMc I+EgsLN6X+lfrSto00QrOQj9MuqJZOJgmhtNOF+M/QYob8IJdgeVz3OoDAzMFYV4zJPZ cqDfjqj7e7z3lLVk77sFojBSXrhpCcJ1ZQSeKUlsDndkk8YvL5wRFuZ/CO/M4biRcRKt jZng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="p9RqB/Qv"; 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 s14si15450911ejq.387.2020.07.07.21.24.03; Tue, 07 Jul 2020 21:24:26 -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="p9RqB/Qv"; 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 S1729129AbgGHEUq (ORCPT + 99 others); Wed, 8 Jul 2020 00:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728234AbgGHEUp (ORCPT ); Wed, 8 Jul 2020 00:20:45 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 281ECC061755; Tue, 7 Jul 2020 21:20:45 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id d10so17636918pls.5; Tue, 07 Jul 2020 21:20:45 -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=Jwf9HX2v4pIKa2lTAdU6rNePQ32bNm3wIaZRAoDNPmQ=; b=p9RqB/Qv885kHcaYGbK7MG7uE6IyTOksWJGE3636Yy8V7MXXoRhfzJLolZNffI+CnG LTP58eb2p39jAuMKyFItSHZbR6JVt6adTZJTMaQABAdoMjBNJs0xLK8e/V7FBlyaX1Ta s80axRCb5GupZ8XBCgB3W1wwSeglej6lURba3oWohYGR2/bRrb5XIjX+53j0L/l8HcrB RHvIAesM22bO+R85TeIHzuwEYgl18jjt2NyGya6p9SpWEBYixIMJMr9WB41MQhfK46aY yTHAJChdvS90kIDD+fL6obu6qwe18il8TIEg7wGr9xr984LczLnwNYauzEwrmDGQOW74 i6MQ== 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=Jwf9HX2v4pIKa2lTAdU6rNePQ32bNm3wIaZRAoDNPmQ=; b=GMZ1v7z256p/MAfsqXPRcx7GxCHlH7RROnsqJcNljVb4sW+jv5Um/xuogYteueMbg/ 5srnP/pka27knrDJLcE3YSh/qrZZfpErA3l1vvcMHAQ6ZM54jpuy45gYENFT/P73f5HW A2HUSE0qrDTEzZJxKirdxL4LMNJMX/YlTsKNUYtPbSXW6FIgwX8ZQExAOKShpqqxM9u7 pl6MpaLJi25X47hU+gpho4wjY47q6DXbnXaKi65m/hzwJ2osWL5GuI722fok+8lY61Zu VDLnknzkdL7/MWanplR+z7Y4dulH/hsDjpWISST21uVH1AaRy+9CsAvFl41ioXyr73p2 RA0g== X-Gm-Message-State: AOAM531bqYD2K8VNQZSmm+y1GlEHpI7LWADMimUNi1Gqwb1MnVs4UCLZ JJmNPJY5LG7gZGRFfg07HThu/QvP X-Received: by 2002:a17:90a:3223:: with SMTP id k32mr7649348pjb.121.1594182043687; Tue, 07 Jul 2020 21:20:43 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 21:20:43 -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 16/17] tools: gpio: fix spurious close warning in gpio-utils Date: Wed, 8 Jul 2020 12:15:59 +0800 Message-Id: <20200708041600.768775-17-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-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gpio/gpio-utils.c b/tools/gpio/gpio-utils.c index 06003789e7c7..16a5d9cb9da2 100644 --- a/tools/gpio/gpio-utils.c +++ b/tools/gpio/gpio-utils.c @@ -75,7 +75,7 @@ int gpiotools_request_linehandle(const char *device_name, unsigned int *lines, ret = -errno; fprintf(stderr, "Failed to open %s, %s\n", chrdev_name, strerror(errno)); - goto exit_close_error; + goto exit_free_name; } for (i = 0; i < nlines; i++) @@ -94,9 +94,9 @@ int gpiotools_request_linehandle(const char *device_name, unsigned int *lines, "GPIO_GET_LINEHANDLE_IOCTL", ret, strerror(errno)); } -exit_close_error: if (close(fd) == -1) perror("Failed to close GPIO character device file"); +exit_free_name: free(chrdev_name); return ret < 0 ? ret : req.fd; } -- 2.27.0