Merge branch 'time_upgrade'
[yaffs2.git] / yaffs_tagsmarshall.c
index 4a120d86825a4405969d73b251655bf527581c8a..397715dbc9eb00f27a79afbd3a5910352e2768bc 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
  *
- * Copyright (C) 2002-2011 Aleph One Ltd.
- *   for Toby Churchill Ltd and Brightstar Engineering
+ * Copyright (C) 2002-2018 Aleph One Ltd.
  *
  * Created by Charles Manning <charles@aleph1.co.uk>
  *
@@ -15,7 +14,7 @@
  * tags storage.
  */
 
-#include "yaffs_guts.h"
+#include "yaffs_tagsmarshall.h"
 #include "yaffs_trace.h"
 #include "yaffs_packedtags2.h"
 
@@ -101,8 +100,12 @@ static int yaffs_tags_marshall_read(struct yaffs_dev *dev,
                BUG();
 
 
-       if (retval == YAFFS_FAIL)
+       if (retval == YAFFS_FAIL) {
+               if (local_data)
+                       yaffs_release_temp_buffer(dev, data);
+
                return YAFFS_FAIL;
+       }
 
        if (dev->param.inband_tags) {
                if (tags) {
@@ -173,10 +176,7 @@ static int yaffs_tags_marshall_query_block(struct yaffs_dev *dev, int block_no,
                "block query returns  seq %d state %d",
                *seq_number, *state);
 
-       if (retval == 0)
-               return YAFFS_OK;
-       else
-               return YAFFS_FAIL;
+       return retval;
 }
 
 static int yaffs_tags_marshall_mark_bad(struct yaffs_dev *dev, int block_no)