<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtk-20170518/package/utils/nvram/src, branch master</title>
<subtitle>MTK 20170518 : Mediatek SDK based on OpenWRT Barrier Breaker</subtitle>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/'/>
<entry>
<title>packages: nvram: fix memory leak in _nvram_free</title>
<updated>2017-11-15T20:11:23+00:00</updated>
<author>
<name>Zhai Zhaoxuan</name>
<email>zhaizhaoxuan@xiaomi.com</email>
</author>
<published>2017-07-11T10:12:00+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=c382237ac33a787043b22abc42f0c5a80278baae'/>
<id>c382237ac33a787043b22abc42f0c5a80278baae</id>
<content type='text'>
The value of nvram_tuple_t is allocated in _nvram_realloc,
but it is not freed in _nvram_free.

Signed-off-by: Zhai Zhaoxuan &lt;zhaizhaoxuan@xiaomi.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The value of nvram_tuple_t is allocated in _nvram_realloc,
but it is not freed in _nvram_free.

Signed-off-by: Zhai Zhaoxuan &lt;zhaizhaoxuan@xiaomi.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nvram: add help message for nvram magic not found</title>
<updated>2017-08-22T12:31:32+00:00</updated>
<author>
<name>BangLang Huang</name>
<email>banglang.huang@foxmail.com</email>
</author>
<published>2017-02-24T02:58:09+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=69da83d9f12e4e48b546fc3fc3ff555034959211'/>
<id>69da83d9f12e4e48b546fc3fc3ff555034959211</id>
<content type='text'>
The program would failed if nvram magic not found
in specific partition.

Signed-off-by: BangLang Huang &lt;banglang.huang@foxmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The program would failed if nvram magic not found
in specific partition.

Signed-off-by: BangLang Huang &lt;banglang.huang@foxmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nvram: improve argument check when program start</title>
<updated>2017-08-22T12:31:32+00:00</updated>
<author>
<name>BangLang Huang</name>
<email>banglang.huang@foxmail.com</email>
</author>
<published>2017-02-24T02:52:52+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=c7e2a6fe923dc86bab14d94ead322a045efca4c9'/>
<id>c7e2a6fe923dc86bab14d94ead322a045efca4c9</id>
<content type='text'>
print help message when argument count is less
than 2.

Signed-off-by: BangLang Huang &lt;banglang.huang@foxmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
print help message when argument count is less
than 2.

Signed-off-by: BangLang Huang &lt;banglang.huang@foxmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nvram: add usage() function</title>
<updated>2017-08-22T12:31:32+00:00</updated>
<author>
<name>BangLang Huang</name>
<email>banglang.huang@foxmail.com</email>
</author>
<published>2017-02-24T02:45:16+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=2a253e7cdbacd1bd19da80ea6f35a93b42655c3b'/>
<id>2a253e7cdbacd1bd19da80ea6f35a93b42655c3b</id>
<content type='text'>
Merge the help message into a single function,
so that we can use it somewhere else.

Signed-off-by: BangLang Huang &lt;banglang.huang@foxmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Merge the help message into a single function,
so that we can use it somewhere else.

Signed-off-by: BangLang Huang &lt;banglang.huang@foxmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nvram: fix memory leak</title>
<updated>2017-08-22T12:31:32+00:00</updated>
<author>
<name>BangLang Huang</name>
<email>banglang.huang@foxmail.com</email>
</author>
<published>2017-02-24T02:16:17+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=1948d8e08c72106a01b359a30217cf92657cc79d'/>
<id>1948d8e08c72106a01b359a30217cf92657cc79d</id>
<content type='text'>
Fix memory leak on nvram_open() and nvram_open_rdonly().

For nvram_open(), the 'fd' should be closed on error, and
mmap_area should be unmap when nvram magic can not be found.

For nvram_open_rdonly(), the 'file' variable should free before
return. Once nvram_find_mtd() return successfully, it will allocate
memory to save mtd device string.

Signed-off-by: BangLang Huang &lt;banglang.huang@foxmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix memory leak on nvram_open() and nvram_open_rdonly().

For nvram_open(), the 'fd' should be closed on error, and
mmap_area should be unmap when nvram magic can not be found.

For nvram_open_rdonly(), the 'file' variable should free before
return. Once nvram_find_mtd() return successfully, it will allocate
memory to save mtd device string.

Signed-off-by: BangLang Huang &lt;banglang.huang@foxmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nvram: get rid of NVRAM_SPACE</title>
<updated>2015-07-08T06:05:43+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>zajec5@gmail.com</email>
</author>
<published>2015-07-08T06:05:43+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=4497c35bd0b84931a4d8be1f5545ba9f0e4c906b'/>
<id>4497c35bd0b84931a4d8be1f5545ba9f0e4c906b</id>
<content type='text'>
Now we support NVRAM whatever its size is.

Signed-off-by: Rafał Miłecki &lt;zajec5@gmail.com&gt;

SVN-Revision: 46262
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now we support NVRAM whatever its size is.

Signed-off-by: Rafał Miłecki &lt;zajec5@gmail.com&gt;

SVN-Revision: 46262
</pre>
</div>
</content>
</entry>
<entry>
<title>nvram: fix displayed info about NVRAM size</title>
<updated>2015-07-08T05:42:30+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>zajec5@gmail.com</email>
</author>
<published>2015-07-08T05:42:30+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=d3721674913e4be33583b30901321b4852b2134d'/>
<id>d3721674913e4be33583b30901321b4852b2134d</id>
<content type='text'>
Use actual partition size and content offset to calculate it.

Signed-off-by: Rafał Miłecki &lt;zajec5@gmail.com&gt;

SVN-Revision: 46260
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use actual partition size and content offset to calculate it.

Signed-off-by: Rafał Miłecki &lt;zajec5@gmail.com&gt;

SVN-Revision: 46260
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Revert "nvram: increase NVRAM size to 64 KiB""</title>
<updated>2015-07-07T22:06:04+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>zajec5@gmail.com</email>
</author>
<published>2015-07-07T22:06:04+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=4014ba376c685bb151324183b64d01cd523aed63'/>
<id>4014ba376c685bb151324183b64d01cd523aed63</id>
<content type='text'>
This reverts commit r45579.

With the latest change r46251 ("nvram: fix "Segmentation fault" caused
by setting memory out of buffer") nvram utility shouldn't crash anymore.

It was tested on 3 brcm47xx devices:
1) Unknown with 0x10000 NVRAM size (0x8000 offset)
2) Linksys E1000 V2.1 with 0x10000 (0x8000 offset)
3) Linksys WRT300N V1 with 0x10000 (0x8000 offset)

And 3 bcm53xx devices:
1) Buffalo WZR-600DHP2 with 0x160000 NVRAM size
2) Buffalo WZR-1750DHP with 0x10000 NVRAM size
3) Netgear R6250 V1 with 0x180000 NVRAM size
(all using 0 offset)

This is an important change as it allows reading whole NVRAM. This may
critical when reading some basic configuration (e.g. switch ports).

Signed-off-by: Rafał Miłecki &lt;zajec5@gmail.com&gt;

SVN-Revision: 46253
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit r45579.

With the latest change r46251 ("nvram: fix "Segmentation fault" caused
by setting memory out of buffer") nvram utility shouldn't crash anymore.

It was tested on 3 brcm47xx devices:
1) Unknown with 0x10000 NVRAM size (0x8000 offset)
2) Linksys E1000 V2.1 with 0x10000 (0x8000 offset)
3) Linksys WRT300N V1 with 0x10000 (0x8000 offset)

And 3 bcm53xx devices:
1) Buffalo WZR-600DHP2 with 0x160000 NVRAM size
2) Buffalo WZR-1750DHP with 0x10000 NVRAM size
3) Netgear R6250 V1 with 0x180000 NVRAM size
(all using 0 offset)

This is an important change as it allows reading whole NVRAM. This may
critical when reading some basic configuration (e.g. switch ports).

Signed-off-by: Rafał Miłecki &lt;zajec5@gmail.com&gt;

SVN-Revision: 46253
</pre>
</div>
</content>
</entry>
<entry>
<title>nvram: fix "Segmentation fault" caused by setting memory out of buffer</title>
<updated>2015-07-07T21:21:49+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>zajec5@gmail.com</email>
</author>
<published>2015-07-07T21:21:49+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=9f158499108eae39555bc65d1abfd86bd0c65533'/>
<id>9f158499108eae39555bc65d1abfd86bd0c65533</id>
<content type='text'>
Some MTD partitions with NVRAM have content starting in the middle. In
such case offset is set and nvram_header returns pointer to the middle.
It means we have to respect offset when calculating remaining space.

By the way use real MTD partition size (nvram_part_size variable) as we
may want to bump NVRAM_SPACE in the (very near) future.

Signed-off-by: Rafał Miłecki &lt;zajec5@gmail.com&gt;

SVN-Revision: 46251
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some MTD partitions with NVRAM have content starting in the middle. In
such case offset is set and nvram_header returns pointer to the middle.
It means we have to respect offset when calculating remaining space.

By the way use real MTD partition size (nvram_part_size variable) as we
may want to bump NVRAM_SPACE in the (very near) future.

Signed-off-by: Rafał Miłecki &lt;zajec5@gmail.com&gt;

SVN-Revision: 46251
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "nvram: increase NVRAM size to 64 KiB"</title>
<updated>2015-04-24T15:38:38+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>zajec5@gmail.com</email>
</author>
<published>2015-04-24T15:38:38+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=63bb07b28c07ef42bc6a2c8c225f24e3e49b6bd7'/>
<id>63bb07b28c07ef42bc6a2c8c225f24e3e49b6bd7</id>
<content type='text'>
This reverts commit ff84c27a281bc19df19bc62ee8688cca5586f6e3.
This tool has really broken size handling (many values hardcoded), it
crashes right now in case of NVRAM not filling whole MTD partition.

Conflicts:
	package/utils/nvram/src/nvram.h

Signed-off-by: Rafał Miłecki &lt;zajec5@gmail.com&gt;

SVN-Revision: 45579
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit ff84c27a281bc19df19bc62ee8688cca5586f6e3.
This tool has really broken size handling (many values hardcoded), it
crashes right now in case of NVRAM not filling whole MTD partition.

Conflicts:
	package/utils/nvram/src/nvram.h

Signed-off-by: Rafał Miłecki &lt;zajec5@gmail.com&gt;

SVN-Revision: 45579
</pre>
</div>
</content>
</entry>
</feed>
