aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/udf/namei.c')
-rw-r--r--fs/udf/namei.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index a126950d79e6..9b5cfc5f725c 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -47,8 +47,6 @@ int udf_write_fi(struct inode *inode, struct fileIdentDesc *cfi,
47{ 47{
48 uint16_t crclen = fibh->eoffset - fibh->soffset - sizeof(tag); 48 uint16_t crclen = fibh->eoffset - fibh->soffset - sizeof(tag);
49 uint16_t crc; 49 uint16_t crc;
50 uint8_t checksum = 0;
51 int i;
52 int offset; 50 int offset;
53 uint16_t liu = le16_to_cpu(cfi->lengthOfImpUse); 51 uint16_t liu = le16_to_cpu(cfi->lengthOfImpUse);
54 uint8_t lfi = cfi->lengthFileIdent; 52 uint8_t lfi = cfi->lengthFileIdent;
@@ -122,13 +120,8 @@ int udf_write_fi(struct inode *inode, struct fileIdentDesc *cfi,
122 120
123 cfi->descTag.descCRC = cpu_to_le16(crc); 121 cfi->descTag.descCRC = cpu_to_le16(crc);
124 cfi->descTag.descCRCLength = cpu_to_le16(crclen); 122 cfi->descTag.descCRCLength = cpu_to_le16(crclen);
123 cfi->descTag.tagChecksum = udf_tag_checksum(&cfi->descTag);
125 124
126 for (i = 0; i < 16; i++) {
127 if (i != 4)
128 checksum += ((uint8_t *)&cfi->descTag)[i];
129 }
130
131 cfi->descTag.tagChecksum = checksum;
132 if (adinicb || (sizeof(struct fileIdentDesc) <= -fibh->soffset)) { 125 if (adinicb || (sizeof(struct fileIdentDesc) <= -fibh->soffset)) {
133 memcpy((uint8_t *)sfi, (uint8_t *)cfi, 126 memcpy((uint8_t *)sfi, (uint8_t *)cfi,
134 sizeof(struct fileIdentDesc)); 127 sizeof(struct fileIdentDesc));