fix wrong use of sizeof in yaffs_checkpt_close
authorliaohua <liaohua4@huawei.com>
Thu, 23 Apr 2020 03:30:20 +0000 (11:30 +0800)
committerCharles Manning <cdhmanning@gmail.com>
Thu, 23 Apr 2020 04:07:51 +0000 (16:07 +1200)
There is a distinct bug that sizeof was used incorrectly,
causing the judgment to be ineffective and always flushing checkpt buffer.

Signed-off-by: liaohua <liaohua4@huawei.com>
yaffs_checkptrw.c

index 53688b5c34d940bc41d9a1896d8e1f718c9293da..f5c3be869565822a70b5101ee50c434a2ab945dc 100644 (file)
@@ -438,7 +438,7 @@ int yaffs_checkpt_close(struct yaffs_dev *dev)
 
        if (dev->checkpt_open_write) {
                if (dev->checkpt_byte_offs !=
-                       sizeof(sizeof(struct yaffs_checkpt_chunk_hdr)))
+                       sizeof(struct yaffs_checkpt_chunk_hdr))
                        yaffs2_checkpt_flush_buffer(dev);
        } else if (dev->checkpt_block_list) {
                for (i = 0;