Message ID | 20211124072909.7540-1-hansson.mattias@gmail.com |
---|---|
State | Superseded |
Delegated to: | Stefano Babic |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=B9h8m2FW; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HzXhN120Hz9t2p for <incoming@patchwork.ozlabs.org>; Wed, 24 Nov 2021 18:29:40 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B809382FD4; Wed, 24 Nov 2021 08:29:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="B9h8m2FW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F3B90835EA; Wed, 24 Nov 2021 08:29:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D1CA482FAD for <u-boot@lists.denx.de>; Wed, 24 Nov 2021 08:29:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=hansson.mattias@gmail.com Received: by mail-ed1-x52b.google.com with SMTP id g14so6071806edb.8 for <u-boot@lists.denx.de>; Tue, 23 Nov 2021 23:29:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NDDDwkHIYak9bFc8uhxn/VHW/6CfSQRLEZ9AVvqMR4A=; b=B9h8m2FWe2jFQn/d6Xc4e/iThcFCjYwOY0RJMz0oa8GYGyMzy7mdHqYGR4OAwb8Agh LwUt5+eKK8O7fiPc3ctssYhtLHs4R53XYmauQtms3Rzqb+PppsW3WjdS8hpXQ7TTzrx0 n7diYE1BUI7bU4NX+kLC3qcxLj2Zen3KhXfAw3AEOC5IO2OmsKwj0Mg3oran3IlpRW8v msUfFL4n8SDlspB6rtcOjqoe+/Tf95ceYkOKDzT/b5HrGWS+j0dyYwJGar/8pm/EazOx N8e1y/GNFziX00uIkC3/uM3gHseh/f461NHqrK3Fqcf8GRSdshIj8iXp9/WT5ItKe4it hciQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NDDDwkHIYak9bFc8uhxn/VHW/6CfSQRLEZ9AVvqMR4A=; b=B3fw/vYVbMnKT5JxQ5VdDbWoHY5lTTxg1yJVLo+U7ek4r2qXFhQFBDU6ZjalN88Xi3 HzT0nJLJoZhYcEryKe7qhcRodbkBqgs7eqvH/MCDUSMN95CzTRde5sfd2NVEsNfj+Nn5 lv+oZ7vQSUa5Hc6eNjG1vxb695VW/CMM2JCaewVdEnxCVlUACxd2B6iUsYqfdfHQc7rY z1f+o8CVreZdAbWZ3kbq70IBKpicrXi6JxkLvIHXt27DRsHHRy+2HyuY6tspur1ZI060 dhe5fnEm2bky30g2irMibF4jR2VgYYqzukT6mtR5uVCvR2yf+rUgUOrQTvmFZqRCCusK 7Ang== X-Gm-Message-State: AOAM532rheNlL+xNntTlQu+djMDPj9CshbXMNlWZSRPl2PXi/lX3XeF0 IBzumYQ8gyt6NIvcXwON5T1EFCJYMOo= X-Google-Smtp-Source: ABdhPJwDe3OuhdL14AAFvxm+5RNf5AYaQ1n39A1EPyFpUSwqvy68Xf6LyPx+7WX7cbQzTSSMk1EgLw== X-Received: by 2002:a17:907:94c2:: with SMTP id dn2mr16721579ejc.325.1637738962197; Tue, 23 Nov 2021 23:29:22 -0800 (PST) Received: from lemon.ad.global (84-216-106-29.customers.ownit.se. [84.216.106.29]) by smtp.gmail.com with ESMTPSA id j14sm7660073edw.96.2021.11.23.23.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 23:29:21 -0800 (PST) From: Mattias Hansson <hansson.mattias@gmail.com> To: u-boot@lists.denx.de Cc: Mattias Hansson <hansson.mattias@gmail.com> Subject: [PATCH] tools/mxsimage: Remove fclose on empty FILE pointer Date: Wed, 24 Nov 2021 08:29:09 +0100 Message-Id: <20211124072909.7540-1-hansson.mattias@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
tools/mxsimage: Remove fclose on empty FILE pointer
|
expand
|
diff --git a/tools/mxsimage.c b/tools/mxsimage.c index 002f4b525a..c7bd86ce52 100644 --- a/tools/mxsimage.c +++ b/tools/mxsimage.c @@ -1618,7 +1618,6 @@ static int sb_load_cmdfile(struct sb_image_ctx *ictx) return 0; err_file: - fclose(fp); fprintf(stderr, "ERR: Failed to load file \"%s\"\n", ictx->cfg_filename); return -EINVAL;
If `sb_load_cmdfile()` fails to open the configuration file it will jump to error handling where the code will try to `fclose()` the FILE pointer which is NULL causing `mkimage` to segfault. This patch removes the `fclose()` since `fopen()` always returns NULL instead of the file descriptor when failing. Signed-off-by: Mattias Hansson <hansson.mattias@gmail.com> --- tools/mxsimage.c | 1 - 1 file changed, 1 deletion(-)