From patchwork Wed Oct 14 08:06:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 1381863 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=posteo.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=posteo.net header.i=@posteo.net header.a=rsa-sha256 header.s=2017 header.b=a7T4K7jn; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CB4lw6JVbz9sTv for ; Wed, 14 Oct 2020 19:07:56 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E6F12823E5; Wed, 14 Oct 2020 10:07:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=posteo.net 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; secure) header.d=posteo.net header.i=@posteo.net header.b="a7T4K7jn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0762823CC; Wed, 14 Oct 2020 10:07:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 67A0E823AA for ; Wed, 14 Oct 2020 10:07:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=posteo.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=richard.genoud@posteo.net Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 12E08240101 for ; Wed, 14 Oct 2020 10:07:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1602662821; bh=tSAySAwKLHTn5gAEa4qk2q5Fn3Qe8/NuUyT0xZZMHH8=; h=From:To:Cc:Subject:Date:From; b=a7T4K7jnH4NrWWBOfO6t2fYSNZKoClk9Vk8s6iLhW/t9lW6cBt6BcVquA1lmf3x0c zTQWtM1Jewgqyz3AKz+vYHFFepa7CTMoVLI3iGG85l+nlXnO6c5lr/W2sCu9xkvpqA YuitqohO5qZKLjhildaOPxcf5NhkXCz/d9ldSMrokh922iov8hzzS/NMY3ZwPXwW2U jPa0hcFf/fHCZa9TJY0ol4ZFVoqdYFGL/SDHExSpnrTAOk0afTSG9zY61qCZHiHR5T LTw2lfeQBA506Lr8plvOmWsf/K09I09a7AmE9/iQWzYCVI1+qSU3j1YPq3cY0Ojqqc zj8VbEU6MXysw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4CB4kr33jBz9rxS; Wed, 14 Oct 2020 10:07:00 +0200 (CEST) From: Richard Genoud To: Joao Marcos Costa , Thomas Petazzoni , Miquel Raynal Cc: u-boot@lists.denx.de, Richard Genoud Subject: [PATCH 01/17] fs/squashfs: fix board hang-up when calling .exists() Date: Wed, 14 Oct 2020 10:06:06 +0200 Message-Id: <20201014080622.14970-2-richard.genoud@posteo.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201014080622.14970-1-richard.genoud@posteo.net> References: <20201014080622.14970-1-richard.genoud@posteo.net> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean add missing squashfs function to prevent dangling or null pointers. For exemple, when calling test [ -e somefile ], squashfs.exists may be called. Signed-off-by: Richard Genoud --- fs/fs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/fs.c b/fs/fs.c index 29ad4d1a695..fb27c910d4f 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -287,6 +287,7 @@ static struct fstype_info fstypes[] = { { .fstype = FS_TYPE_SQUASHFS, .name = "squashfs", + .null_dev_desc_ok = false, .probe = sqfs_probe, .opendir = sqfs_opendir, .readdir = sqfs_readdir, @@ -295,6 +296,12 @@ static struct fstype_info fstypes[] = { .size = sqfs_size, .close = sqfs_close, .closedir = sqfs_closedir, + .exists = fs_exists_unsupported, + .uuid = fs_uuid_unsupported, + .write = fs_write_unsupported, + .ln = fs_ln_unsupported, + .unlink = fs_unlink_unsupported, + .mkdir = fs_mkdir_unsupported, }, #endif {