Skip to contentSkip to conversation

fs: exfat: Remove unused label code

PATCH In review Andrew Goodbody 2 participants 2 messages Jul 17, 2025 – Jul 24, 2025 exFAT file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fs: exfat: Remove unused label code

Smatch reported a possible buffer overflow in exfat_set_label but it turns out that this code is unused so just guard the function with '#ifndef __UBOOT__' as well as exfat_get_label that is also unused and the helper static find_label.

---
Changes in v2:
- Instead of removing the code just guard it with #ifndef __UBOOT__ to
make future resyncs easier from upstream
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 fs/exfat/exfat.h | 2 ++
 fs/exfat/node.c  | 2 ++
 2 files changed, 4 insertions(+)
fs/exfat/exfat.h +2 -0
index ca6f22b9d58..bd2965c3942 100644
@@ -237,8 +237,10 @@ int exfat_rename(struct exfat* ef, const char* old_path, const char* new_path);
 void exfat_utimes(struct exfat_node* node, const struct timespec tv[2]);
 void exfat_update_atime(struct exfat_node* node);
 void exfat_update_mtime(struct exfat_node* node);
+#ifndef __UBOOT__
 const char* exfat_get_label(struct exfat* ef);
 int exfat_set_label(struct exfat* ef, const char* label);
+#endif /* __UBOOT__ */
 
 int exfat_soil_super_block(const struct exfat* ef);
 int exfat_mount(struct exfat* ef, const char* spec, const char* options);
fs/exfat/node.c +2 -0
index 88b1357189c..b7406fbf3ed 100644
@@ -1188,6 +1188,7 @@ void exfat_update_mtime(struct exfat_node* node)
 	node->is_dirty = true;
 }
 
+#ifndef __UBOOT__
 const char* exfat_get_label(struct exfat* ef)
 {
 	return ef->label;
@@ -1241,3 +1242,4 @@ int exfat_set_label(struct exfat* ef, const char* label)
 	strcpy(ef->label, label);
 	return 0;
 }
+#endif /* __UBOOT__ */

---
base-commit: 3b4604a40b9fd61b87e9d059fc56f04d36f1a380
change-id: 20250717-exfat_label-bf4af04ea293

Best regards,

Signature · 1 line
Andrew Goodbody <[email protected]>
#1 lore raw
Quoted 6 lines · Andrew Goodbody

Smatch reported a possible buffer overflow in exfat_set_label but it turns out that this code is unused so just guard the function with '#ifndef __UBOOT__' as well as exfat_get_label that is also unused and the helper static find_label.

Applied to u-boot/master, thanks!

[1/1] fs: exfat: Remove unused label code

      commit: 8f3820dc3a262b0d11c261bf3c526159d8c771e3
Signature · 1 line
Tom