From patchwork Mon Dec 22 11:56:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1046 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766404655; bh=brffyqS5vRVoFUysliwLc3vSwaPy2PFtbbupamPh02I=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=MZQMpkqXIJNkzkNj7494TES0ehP5XySOCyv1oo6cQmxcisEFyze5uG4b7uUVvEU9e hbNqeG/yOghPqn95Pjw28pus6ADTJ4X0wVuFpbZ0nmtEI/NlGalTytOBMw/oZcVoI6 eHgWGaEXnH7YweKFKmvxqe49dNiDCJPjIiMBHWkWXTMgfkAhJeAPY2gO5iWWDGFlK3 S3h//fhoUY14F8VfqxbeJQQJO/2TMNSrXGeD03s8IJ4D9lp6PoDX360WkUzwpSU/sK 3XSu6hKN0u95J7qairwqDPWae5yWP7FYLlCdtLwJ/+hItiWo9f/DvBVE9uUbYI3Q7I viqWM1iy5ojqg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5270364D75 for ; Mon, 22 Dec 2025 04:57:35 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5a9VwLeDKSVO for ; Mon, 22 Dec 2025 04:57:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766404655; bh=brffyqS5vRVoFUysliwLc3vSwaPy2PFtbbupamPh02I=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=MZQMpkqXIJNkzkNj7494TES0ehP5XySOCyv1oo6cQmxcisEFyze5uG4b7uUVvEU9e hbNqeG/yOghPqn95Pjw28pus6ADTJ4X0wVuFpbZ0nmtEI/NlGalTytOBMw/oZcVoI6 eHgWGaEXnH7YweKFKmvxqe49dNiDCJPjIiMBHWkWXTMgfkAhJeAPY2gO5iWWDGFlK3 S3h//fhoUY14F8VfqxbeJQQJO/2TMNSrXGeD03s8IJ4D9lp6PoDX360WkUzwpSU/sK 3XSu6hKN0u95J7qairwqDPWae5yWP7FYLlCdtLwJ/+hItiWo9f/DvBVE9uUbYI3Q7I viqWM1iy5ojqg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4280A64D3E for ; Mon, 22 Dec 2025 04:57:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766404652; bh=nN+CG2/nDtDPJRW+4SGFtnk4zhijZLQEe1YNHi1TyrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eJUhNfHpZuUZ5qzN0ACJKlJ1oOl6CsjNfp5tLyQm53gJazlhsn+ws6ReKFdJuCEdt Y16Hdh8I6LOz0WTan/kH9bGHfzoSm8DIEnJcIN4ZOJW7aDMO9jCCIDs3YMPGPgAz+z v9XUIPPryUwisYihhAJZdSJcJ20oIKJFr/Zh48HbdsF9eiiSHSj+1sQwxR0qRYHyts WxahAOPPZYIw6Ph4HLjYo+WI2mvWzXaeeabaVeIZHn2SZf+j9mY1ZCSKKbGss31NxM re2F+268M35NjL33grij4bDjnwa2GEMnOkbHnr8mc+3onUvUVuBNexUJKpp3nKyu3o ZkImX0iLHe3Kg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D467164C31; Mon, 22 Dec 2025 04:57:32 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id muXamyGv7Me6; Mon, 22 Dec 2025 04:57:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1766404651; bh=yLeUWJsj8RhS0OkNaRyK6MS6Ek7hz8Knsz4/dY5tpf4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aD3FxpiSjFIstEC8/04RzqW/nAWrCiTvu2b4bwSTXyvsPCnK8z67mdRy8EIrcYqP5 LyJyOmPIg0+f+sKXVNt+LwuvektaLkoSKER4JsHo0I6JHDSjeVPE4DTtDD3EQH/0Wd 8KG4kDXJoa4/f5oVq1hCn9u6LGEVHhYlgcMZInpzHrGnp+O5sSRy0tTOXyVji2iJf8 rpDFBaCtqh78oE5YJVEZGSCS1dFhcSlfSjhCL3jZc00hq5F9rY96v3pzQxKgESXjW1 BSFsUMvvEWcUzev7hrzCCg5tB9tROfqm2RDslok6Y6NyFkWn+wFDvqDN6+t/22nlI4 XgY/cYewBwnSA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E6A9A5FB5A; Mon, 22 Dec 2025 04:57:30 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Dec 2025 04:56:20 -0700 Message-ID: <20251222115639.700578-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251222115639.700578-1-sjg@u-boot.org> References: <20251222115639.700578-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TKGQFD4E5PNMJ3B63IKSAXIVM363AHRI X-Message-ID-Hash: TKGQFD4E5PNMJ3B63IKSAXIVM363AHRI X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/26] fs: ext4l: Allocate fs_context List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add allocation of fs_context structure which will be needed for mounting the filesystem via ext4_fill_super(). Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- fs/ext4l/interface.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/ext4l/interface.c b/fs/ext4l/interface.c index 792928b4b6c..b653b7ef981 100644 --- a/fs/ext4l/interface.c +++ b/fs/ext4l/interface.c @@ -27,6 +27,7 @@ int ext4l_probe(struct blk_desc *fs_dev_desc, struct disk_partition *fs_partition) { struct super_block *sb; + struct fs_context *fc; loff_t part_offset; __le16 *magic; u8 *buf; @@ -74,10 +75,17 @@ int ext4l_probe(struct blk_desc *fs_dev_desc, goto err_free_bdev; } + /* Allocate fs_context */ + fc = kzalloc(sizeof(struct fs_context), GFP_KERNEL); + if (!fc) { + ret = -ENOMEM; + goto err_free_mapping; + } + buf = malloc(BLOCK_SIZE + 512); if (!buf) { ret = -ENOMEM; - goto err_free_mapping; + goto err_free_fc; } /* Calculate partition offset in bytes */ @@ -105,6 +113,7 @@ int ext4l_probe(struct blk_desc *fs_dev_desc, memcpy(&ext4l_part, fs_partition, sizeof(ext4l_part)); free(buf); + kfree(fc); kfree(sb->s_bdev->bd_mapping); kfree(sb->s_bdev); kfree(sb); @@ -113,6 +122,8 @@ int ext4l_probe(struct blk_desc *fs_dev_desc, err_free_buf: free(buf); +err_free_fc: + kfree(fc); err_free_mapping: kfree(sb->s_bdev->bd_mapping); err_free_bdev: