<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/fs/ubifs, branch next</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>treewide: Clean up DECLARE_GLOBAL_DATA_PTR usage</title>
<updated>2026-02-17T19:50:22+00:00</updated>
<author>
<name>Peng Fan</name>
<email>peng.fan@nxp.com</email>
</author>
<published>2026-02-09T01:30:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0f90b1e715f8abe41b0875752eb184f46032ff11'/>
<id>0f90b1e715f8abe41b0875752eb184f46032ff11</id>
<content type='text'>
Remove DECLARE_GLOBAL_DATA_PTR from files where gd is not used, and
drop the unnecessary inclusion of asm/global_data.h.

Headers should be included directly by the files that need them,
rather than indirectly via global_data.h.

Reviewed-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt; #STMicroelectronics boards and STM32MP1 ram test driver
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt; #TI boards
Acked-by: Yao Zi &lt;me@ziyao.cc&gt; #TH1520
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove DECLARE_GLOBAL_DATA_PTR from files where gd is not used, and
drop the unnecessary inclusion of asm/global_data.h.

Headers should be included directly by the files that need them,
rather than indirectly via global_data.h.

Reviewed-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt; #STMicroelectronics boards and STM32MP1 ram test driver
Tested-by: Anshul Dalal &lt;anshuld@ti.com&gt; #TI boards
Acked-by: Yao Zi &lt;me@ziyao.cc&gt; #TH1520
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ubifs: Fix and rework error handling in ubifs_finddir</title>
<updated>2025-10-08T09:36:05+00:00</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-10-03T10:42:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0cab29ff467e297064a9fc30200347bda06ee0c4'/>
<id>0cab29ff467e297064a9fc30200347bda06ee0c4</id>
<content type='text'>
Add a null check for 'file' before dereferencing it and also rework the
error handling to be a bit more sane.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a null check for 'file' before dereferencing it and also rework the
error handling to be a bit more sane.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ubifs: Need to check return for being an error pointer</title>
<updated>2025-10-08T09:36:00+00:00</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-10-03T10:42:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=51615eb4f7bcd3367aecdeaea3638058ef5407f3'/>
<id>51615eb4f7bcd3367aecdeaea3638058ef5407f3</id>
<content type='text'>
The return value from alloc_super can be an error pointer so the error
check needs to detect this as well as checking the pointer for being
NULL.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The return value from alloc_super can be an error pointer so the error
check needs to detect this as well as checking the pointer for being
NULL.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ubifs: Ensure buf is freed before return</title>
<updated>2025-10-08T09:35:47+00:00</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-10-03T10:42:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d23ddd5dee570e625e0fd76bba1e155f4cc1248c'/>
<id>d23ddd5dee570e625e0fd76bba1e155f4cc1248c</id>
<content type='text'>
Returning directly after buf has been allocated will result in a memory
leak. Instead set the error code and goto the common unwind code to
ensure that buf will be freed before returning.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Returning directly after buf has been allocated will result in a memory
leak. Instead set the error code and goto the common unwind code to
ensure that buf will be freed before returning.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ubifs: Remove unnecessary assignment</title>
<updated>2025-01-28T05:44:18+00:00</updated>
<author>
<name>Michal Simek</name>
<email>michal.simek@amd.com</email>
</author>
<published>2025-01-24T13:17:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=14e02d6c6180f85114cc0a90469e010a5d68b2ee'/>
<id>14e02d6c6180f85114cc0a90469e010a5d68b2ee</id>
<content type='text'>
Variable self assignment has been found by clang. But Linux kernel already
fixed this problem by commit 2a068daf5742 ("ubifs: Remove unnecessary
assignment") and commit ae4c8081eb77 ("ubifs: remove unnecessary
assignment").

Signed-off-by: Michal Simek &lt;michal.simek@amd.com&gt;
Reviewed-by: Alexander Dahl &lt;ada@thorsis.com&gt;
Reviewed-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Variable self assignment has been found by clang. But Linux kernel already
fixed this problem by commit 2a068daf5742 ("ubifs: Remove unnecessary
assignment") and commit ae4c8081eb77 ("ubifs: remove unnecessary
assignment").

Signed-off-by: Michal Simek &lt;michal.simek@amd.com&gt;
Reviewed-by: Alexander Dahl &lt;ada@thorsis.com&gt;
Reviewed-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ubifs: Call ubifs_iput when ubifs_iget is used</title>
<updated>2024-08-11T04:52:15+00:00</updated>
<author>
<name>Michael Trimarchi</name>
<email>michael@amarulasolutions.com</email>
</author>
<published>2024-08-10T12:57:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d16bda85ff0762aa96e36fa65d2e3b5342d73d7a'/>
<id>d16bda85ff0762aa96e36fa65d2e3b5342d73d7a</id>
<content type='text'>
The inode should be freed after a reference is get to avoid
memory leak

Tested-by: Alexander Dahl &lt;ada@thorsis.com&gt;
Link: https://lore.kernel.org/u-boot/b698ec3e-d857-6512-8cc9-4edcab0a41b9@denx.de/T/#t
Link: https://lore.kernel.org/all/8f3a7059-6330-f332-8e9f-729b853e001e@denx.de/T/
Co-developed-by: Heiko Schocher &lt;hs@denx.de&gt;
Signed-off-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The inode should be freed after a reference is get to avoid
memory leak

Tested-by: Alexander Dahl &lt;ada@thorsis.com&gt;
Link: https://lore.kernel.org/u-boot/b698ec3e-d857-6512-8cc9-4edcab0a41b9@denx.de/T/#t
Link: https://lore.kernel.org/all/8f3a7059-6330-f332-8e9f-729b853e001e@denx.de/T/
Co-developed-by: Heiko Schocher &lt;hs@denx.de&gt;
Signed-off-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ubifs: mount fails after power cycle</title>
<updated>2024-08-10T09:56:53+00:00</updated>
<author>
<name>Ravi Minnikanti</name>
<email>rminnikanti@marvell.com</email>
</author>
<published>2024-07-30T09:14:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=cf7ea719ce60cd885cce5023dfaf7833d9fc1442'/>
<id>cf7ea719ce60cd885cce5023dfaf7833d9fc1442</id>
<content type='text'>
When kernel uses file system encryption, fscrypt on UBIFS v5,
after a hard power cycle UBIFS journal replay fails which results in mount failure.

Failure logs:
UBIFS: recovery needed
UBIFS error (pid 0): ubifs_validate_entry: bad directory entry node
UBIFS error (pid 0): replay_bud: bad node is at LEB 890:24576
UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume 'ubi0:rootfs' errno=-22!

This change is ported from kernel:
commit id: 304790c038bc4af4f19774705409db27eafb09fc

Kernel commit description:
    Kernel commit description:
    ubifs: Relax checks in ubifs_validate_entry()

    With encrypted filenames we store raw binary data, doing
    string tests is no longer possible.

Signed-off-by: rminnikanti &lt;rminnikanti@marvell.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When kernel uses file system encryption, fscrypt on UBIFS v5,
after a hard power cycle UBIFS journal replay fails which results in mount failure.

Failure logs:
UBIFS: recovery needed
UBIFS error (pid 0): ubifs_validate_entry: bad directory entry node
UBIFS error (pid 0): replay_bud: bad node is at LEB 890:24576
UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume 'ubi0:rootfs' errno=-22!

This change is ported from kernel:
commit id: 304790c038bc4af4f19774705409db27eafb09fc

Kernel commit description:
    Kernel commit description:
    ubifs: Relax checks in ubifs_validate_entry()

    With encrypted filenames we store raw binary data, doing
    string tests is no longer possible.

Signed-off-by: rminnikanti &lt;rminnikanti@marvell.com&gt;
Reviewed-by: Heiko Schocher &lt;hs@denx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ubifs: Add volume mounted check</title>
<updated>2024-08-10T09:54:28+00:00</updated>
<author>
<name>Alexander Dahl</name>
<email>ada@thorsis.com</email>
</author>
<published>2024-07-03T10:12:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ca1f11d8c11dacd91c3bfd8e39d41db349e83f8b'/>
<id>ca1f11d8c11dacd91c3bfd8e39d41db349e83f8b</id>
<content type='text'>
Safety guard in the U-Boot filesystem glue code, because these functions
are called from different parts of the codebase.  For generic filesystem
handling this should have been checked in blk_get_device_part_str()
already.  Commands from cmd/ubifs.c should also check this before
calling those functions, but you never know?!

Signed-off-by: Alexander Dahl &lt;ada@thorsis.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Safety guard in the U-Boot filesystem glue code, because these functions
are called from different parts of the codebase.  For generic filesystem
handling this should have been checked in blk_get_device_part_str()
already.  Commands from cmd/ubifs.c should also check this before
calling those functions, but you never know?!

Signed-off-by: Alexander Dahl &lt;ada@thorsis.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ubifs: Make k(z)alloc/kfree symmetric</title>
<updated>2024-08-10T09:54:20+00:00</updated>
<author>
<name>Alexander Dahl</name>
<email>ada@thorsis.com</email>
</author>
<published>2024-07-03T10:12:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0989033d0968878bd8f5d42d4f507dc9a806cfe4'/>
<id>0989033d0968878bd8f5d42d4f507dc9a806cfe4</id>
<content type='text'>
Although kfree() is in fact only a slim wrapper to free() in U-Boot, use
kfree() here, because those structs where allocated with kalloc() or
kzalloc().

Signed-off-by: Alexander Dahl &lt;ada@thorsis.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Although kfree() is in fact only a slim wrapper to free() in U-Boot, use
kfree() here, because those structs where allocated with kalloc() or
kzalloc().

Signed-off-by: Alexander Dahl &lt;ada@thorsis.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fs: ubifs: Set pointers to NULL after free</title>
<updated>2024-08-10T09:54:10+00:00</updated>
<author>
<name>Alexander Dahl</name>
<email>ada@thorsis.com</email>
</author>
<published>2024-07-03T10:12:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=573dae50f5fe2c84ff8329bd8dbf54d234952579'/>
<id>573dae50f5fe2c84ff8329bd8dbf54d234952579</id>
<content type='text'>
Global superblock pointer 'ubifs_sb' and volume pointer 'ubi' of type
struct ubi_volume_desc in private member sb-&gt;s_fs_info of type struct
ubifs_info, can be allocated and freed at runtime, and allocated and
freed again, depending which console or script commands are run.  In
some cases ubifs_sb is even tested to determine if the filesystem is
mounted.  Reset those pointers to NULL after free to clearly mark them
as not valid.  This avoids potential double free on invalid pointers.

(The ubifs_sb pointer was already reset, but that statement was moved
now to directly after the free() to make it easier to understand.)

Signed-off-by: Alexander Dahl &lt;ada@thorsis.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Global superblock pointer 'ubifs_sb' and volume pointer 'ubi' of type
struct ubi_volume_desc in private member sb-&gt;s_fs_info of type struct
ubifs_info, can be allocated and freed at runtime, and allocated and
freed again, depending which console or script commands are run.  In
some cases ubifs_sb is even tested to determine if the filesystem is
mounted.  Reset those pointers to NULL after free to clearly mark them
as not valid.  This avoids potential double free on invalid pointers.

(The ubifs_sb pointer was already reset, but that statement was moved
now to directly after the free() to make it easier to understand.)

Signed-off-by: Alexander Dahl &lt;ada@thorsis.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
