summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/exofs/super.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index d9619a577806..6c5397ad7a2a 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -529,7 +529,8 @@ static int exofs_devs_2_odi(struct exofs_dt_device_info *dt_dev,
struct osd_dev_info *odi)
{
odi->systemid_len = le32_to_cpu(dt_dev->systemid_len);
- memcpy(odi->systemid, dt_dev->systemid, odi->systemid_len);
+ if (likely(odi->systemid_len))
+ memcpy(odi->systemid, dt_dev->systemid, OSD_SYSTEMID_LEN);
odi->osdname_len = le32_to_cpu(dt_dev->osdname_len);
odi->osdname = dt_dev->osdname;