<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/of/dynamic.c, branch v4.4.162</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.162</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.162'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-08-20T16:09:25Z</updated>
<entry>
<title>of: fix memory leak related to safe_name()</title>
<updated>2016-08-20T16:09:25Z</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@am.sony.com</email>
</author>
<published>2016-06-16T17:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2c00c2171c0d525f49e8c36d79082ee33fba8b10'/>
<id>urn:sha1:2c00c2171c0d525f49e8c36d79082ee33fba8b10</id>
<content type='text'>
commit d9fc880723321dbf16b2981e3f3e916b73942210 upstream.

Fix a memory leak resulting from memory allocation in safe_name().
This patch fixes all call sites of safe_name().

Mathieu Malaterre reported the memory leak on boot:

On my PowerMac device-tree would generate a duplicate name:

[    0.023043] device-tree: Duplicate name in PowerPC,G4@0, renamed to "l2-cache#1"

in this case a newly allocated name is generated by `safe_name`. However
in this case it is never deallocated.

The bug was found using kmemleak reported as:

unreferenced object 0xdf532e60 (size 32):
  comm "swapper", pid 1, jiffies 4294892300 (age 1993.532s)
  hex dump (first 32 bytes):
    6c 32 2d 63 61 63 68 65 23 31 00 dd e4 dd 1e c2  l2-cache#1......
    ec d4 ba ce 04 ec cc de 8e 85 e9 ca c4 ec cc 9e  ................
  backtrace:
    [&lt;c02d3350&gt;] kvasprintf+0x64/0xc8
    [&lt;c02d3400&gt;] kasprintf+0x4c/0x5c
    [&lt;c0453814&gt;] safe_name.isra.1+0x80/0xc4
    [&lt;c04545d8&gt;] __of_attach_node_sysfs+0x6c/0x11c
    [&lt;c075f21c&gt;] of_core_init+0x8c/0xf8
    [&lt;c0729594&gt;] kernel_init_freeable+0xd4/0x208
    [&lt;c00047e8&gt;] kernel_init+0x24/0x11c
    [&lt;c00158ec&gt;] ret_from_kernel_thread+0x5c/0x64

Link: https://bugzilla.kernel.org/show_bug.cgi?id=120331

Signed-off-by: Frank Rowand &lt;frank.rowand@am.sony.com&gt;
Reported-by: mathieu.malaterre@gmail.com
Tested-by: Mathieu Malaterre &lt;mathieu.malaterre@gmail.com&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>of/dynamic: Fix test for PPC_PSERIES</title>
<updated>2015-06-05T01:39:28Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2015-06-04T09:34:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f76502aa9140ec338a59487218bf70a9c9e92b8f'/>
<id>urn:sha1:f76502aa9140ec338a59487218bf70a9c9e92b8f</id>
<content type='text'>
"IS_ENABLED(PPC_PSERIES)" always evaluates to false, as IS_ENABLED() is
supposed to be used with the full Kconfig symbol name, including the
"CONFIG_" prefix.

Add the missing "CONFIG_" prefix to fix this.

Fixes: a25095d451ece23b ("of: Move dynamic node fixups out of powerpc and into common code")

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Cc: stable@vger.kernel.org #+3.17
Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
</entry>
<entry>
<title>of/reconfig: Always use the same structure for notifiers</title>
<updated>2014-11-24T22:25:03Z</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-11-24T17:58:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f5242e5a883bf1c1aba6bfd87b85e7dda0e62191'/>
<id>urn:sha1:f5242e5a883bf1c1aba6bfd87b85e7dda0e62191</id>
<content type='text'>
The OF_RECONFIG notifier callback uses a different structure depending
on whether it is a node change or a property change. This is silly, and
not very safe. Rework the code to use the same data structure regardless
of the type of notifier.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Pantelis Antoniou &lt;pantelis.antoniou@konsulko.com&gt;
Cc: &lt;linuxppc-dev@lists.ozlabs.org&gt;
</content>
</entry>
<entry>
<title>of/reconfig: Add debug output for OF_RECONFIG notifiers</title>
<updated>2014-11-24T22:25:00Z</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-11-14T14:34:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=00aa37206e1a54dae61a0dba96bf2ee0938b99d7'/>
<id>urn:sha1:00aa37206e1a54dae61a0dba96bf2ee0938b99d7</id>
<content type='text'>
Add some additional debug output to cover OF_RECONFIG notifier activity.
At the same time, refactor the changeset debug output to use the same
strings as the notifier debug output.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
</entry>
<entry>
<title>of/reconfig: Add of_reconfig_get_state_change() of notifier helper.</title>
<updated>2014-11-24T22:24:54Z</updated>
<author>
<name>Pantelis Antoniou</name>
<email>pantelis.antoniou@konsulko.com</email>
</author>
<published>2014-10-28T20:33:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b53a2340d0d30468b7315992ba77fe188c3bc5c8'/>
<id>urn:sha1:b53a2340d0d30468b7315992ba77fe188c3bc5c8</id>
<content type='text'>
Introduce of_reconfig_get_state_change() which allows an of notifier
to query about device state changes.

Signed-off-by: Pantelis Antoniou &lt;pantelis.antoniou@konsulko.com&gt;
Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
</entry>
<entry>
<title>of: Refactor __of_node_alloc() into __of_node_dup()</title>
<updated>2014-11-24T22:24:41Z</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-11-17T22:31:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e51795815ef1a7adc018cbaf05aac46e3d24eda8'/>
<id>urn:sha1:e51795815ef1a7adc018cbaf05aac46e3d24eda8</id>
<content type='text'>
Add a node argument to __of_node_alloc() and rename it to
__of_node_dup() so that it can also be used to duplicate a node with
its properties. This is important for the overlay code so that it can
create new nodes without using separate changeset items for every single
property.

At the same time rework the overlay code to use the new function and
drop the extra changeset items.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
</entry>
<entry>
<title>of: Use vargs in __of_node_alloc</title>
<updated>2014-11-24T22:23:35Z</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-11-14T15:33:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ef8bbd73a76197cf8362a2b43aaadc5717bd0746'/>
<id>urn:sha1:ef8bbd73a76197cf8362a2b43aaadc5717bd0746</id>
<content type='text'>
The overlay code needs to construct a new full_name from the parent name
and the node name, but the current method has to allocate and then free
an temporary string which is wasteful. Fix this problem by using vargs
to pass in a format and arguments into __of_node_alloc().

At the same time remove the allocflags argument to __of_node_alloc().
The only users all use GFP_KERNEL, so there is no need to provide it as
an option. If there is ever a need later it can be added back.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v3.18-rc6' into devicetree/next</title>
<updated>2014-11-24T14:50:07Z</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-11-24T14:50:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=66e6a5a1fcd2f3e05f4d499b539a1f77ceb52d1d'/>
<id>urn:sha1:66e6a5a1fcd2f3e05f4d499b539a1f77ceb52d1d</id>
<content type='text'>
v3.18-rc6 contains an important DT bug fix, c1a2086e2d, "of/selftest:
Fix off-by-one error in removal path" which affects testing of the
overlay patch series. Merge it into the devicetree/next staging branch
so that the overlay patches are applied on top of a known working tree.

Linux 3.18-rc6

Conflicts:
	drivers/of/address.c
</content>
</entry>
<entry>
<title>of: Spelling s/stucture/structure/</title>
<updated>2014-11-18T17:33:10Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2014-10-22T09:49:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=27b3383a1432127bfcf9f8a63bf184ff4d866141'/>
<id>urn:sha1:27b3383a1432127bfcf9f8a63bf184ff4d866141</id>
<content type='text'>
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Cc: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Signed-off-by: Rob Herring &lt;robh@kernel.org&gt;
</content>
</entry>
<entry>
<title>of: Eliminate of_allnodes list</title>
<updated>2014-11-04T13:29:38Z</updated>
<author>
<name>Grant Likely</name>
<email>grant.likely@linaro.org</email>
</author>
<published>2014-10-03T15:28:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5063e25a302e6a83f6590d9a06bd5f6400b17430'/>
<id>urn:sha1:5063e25a302e6a83f6590d9a06bd5f6400b17430</id>
<content type='text'>
The device tree structure is composed of two lists; the 'allnodes' list
which is a singly linked list containing every node in the tree, and the
child-&gt;parent structure where each parent node has a singly linked list
of children. All of the data in the allnodes list can be easily
reproduced with the parent-child lists, so of_allnodes is actually
unnecessary. Remove it entirely which saves a bit of memory and
simplifies the data structure quite a lot.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Rob Herring &lt;robh@kernel.org&gt;
Cc: Gaurav Minocha &lt;gaurav.minocha.os@gmail.com&gt;
Cc: Pantelis Antoniou &lt;pantelis@pantelis.antoniou@konsulko.com&gt;
</content>
</entry>
</feed>
