<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/staging/greybus/light.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/staging/greybus/light.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/staging/greybus/light.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-01-05T14:26:43Z</updated>
<entry>
<title>staging: greybus: light: Use kzalloc for allocating only one thing</title>
<updated>2021-01-05T14:26:43Z</updated>
<author>
<name>Zheng Yongjun</name>
<email>zhengyongjun3@huawei.com</email>
</author>
<published>2020-12-30T01:37:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=6500966d211c4a265600b4561d9c479088fce0a1'/>
<id>urn:sha1:6500966d211c4a265600b4561d9c479088fce0a1</id>
<content type='text'>
Use kzalloc rather than kcalloc(1,...)

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@@
@@

- kcalloc(1,
+ kzalloc(
          ...)
// &lt;/smpl&gt;

Reviewed-by: Alex Elder &lt;elder@linaro.org&gt;
Reviewed-by: Rui Miguel Silva &lt;rmfrfs@gmail.com&gt;
Signed-off-by: Zheng Yongjun &lt;zhengyongjun3@huawei.com&gt;
Link: https://lore.kernel.org/r/20201230013706.28698-1-zhengyongjun3@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: greybus: fix a missing-check bug in gb_lights_light_config()</title>
<updated>2020-04-13T06:55:26Z</updated>
<author>
<name>Chen Zhou</name>
<email>chenzhou10@huawei.com</email>
</author>
<published>2020-04-01T03:00:17Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9bb086e5ba9495ac150fbbcc5c8c2bccc06261dd'/>
<id>urn:sha1:9bb086e5ba9495ac150fbbcc5c8c2bccc06261dd</id>
<content type='text'>
In gb_lights_light_config(), 'light-&gt;name' is allocated by kstrndup().
It returns NULL when fails, add check for it.

Signed-off-by: Chen Zhou &lt;chenzhou10@huawei.com&gt;
Acked-by: Rui Miguel Silva &lt;rmfrfs@gmail.com&gt;
Link: https://lore.kernel.org/r/20200401030017.100274-1-chenzhou10@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: greybus: light: fix a couple double frees</title>
<updated>2019-09-03T07:39:10Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2019-08-29T12:28:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=329101244f214952606359d254ae883b7109e1a5'/>
<id>urn:sha1:329101244f214952606359d254ae883b7109e1a5</id>
<content type='text'>
The problem is in gb_lights_request_handler().  If we get a request to
change the config then we release the light with gb_lights_light_release()
and re-allocated it.  However, if the allocation fails part way through
then we call gb_lights_light_release() again.  This can lead to a couple
different double frees where we haven't cleared out the original values:

	gb_lights_light_v4l2_unregister(light);
	...
	kfree(light-&gt;channels);
	kfree(light-&gt;name);

I also made a small change to how we set "light-&gt;channels_count = 0;".
The original code handled this part fine and did not cause a use after
free but it was sort of complicated to read.

Fixes: 2870b52bae4c ("greybus: lights: add lights implementation")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Rui Miguel Silva &lt;rmfrfs@gmail.com&gt;
Link: https://lore.kernel.org/r/20190829122839.GA20116@mwanda
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: greybus: move core include files to include/linux/greybus/</title>
<updated>2019-08-27T17:02:59Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-08-25T05:54:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ec0ad868173da8a75121f9dc116a5d5478ff614d'/>
<id>urn:sha1:ec0ad868173da8a75121f9dc116a5d5478ff614d</id>
<content type='text'>
With the goal of moving the core of the greybus code out of staging, the
include files need to be moved to include/linux/greybus.h and
include/linux/greybus/

Cc: Vaibhav Hiremath &lt;hvaibhav.linux@gmail.com&gt;
Cc: Johan Hovold &lt;johan@kernel.org&gt;
Cc: Vaibhav Agarwal &lt;vaibhav.sr@gmail.com&gt;
Cc: Rui Miguel Silva &lt;rmfrfs@gmail.com&gt;
Cc: David Lin &lt;dtwlin@gmail.com&gt;
Cc: "Bryan O'Donoghue" &lt;pure.logic@nexus-software.ie&gt;
Cc: greybus-dev@lists.linaro.org
Cc: devel@driverdev.osuosl.org
Acked-by: Mark Greer &lt;mgreer@animalcreek.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Acked-by: Alex Elder &lt;elder@kernel.org&gt;
Link: https://lore.kernel.org/r/20190825055429.18547-8-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: greybus: Remove redundant license text</title>
<updated>2017-11-11T13:46:21Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-11-07T13:58:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=863dbc52e7f0e5acd7b4883f3933543a81c474c7'/>
<id>urn:sha1:863dbc52e7f0e5acd7b4883f3933543a81c474c7</id>
<content type='text'>
Now that the SPDX tag is in all greybus files, that identifies the
license in a specific and legally-defined manner.  So the extra GPL text
wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Cc: Vaibhav Hiremath &lt;hvaibhav.linux@gmail.com&gt;
Reviewed-by: Alex Elder &lt;elder@linaro.org&gt;
Acked-by: Vaibhav Agarwal &lt;vaibhav.sr@gmail.com&gt;
Acked-by: David Lin &lt;dtwlin@gmail.com&gt;
Acked-by: Johan Hovold &lt;johan@kernel.org&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Acked-by: Mark Greer &lt;mgreer@animalcreek.com&gt;
Acked-by: Rui Miguel Silva &lt;rmfrfs@gmail.com&gt;
Acked-by: "Bryan O'Donoghue" &lt;pure.logic@nexus-software.ie&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: greybus: add SPDX identifiers to all greybus driver files</title>
<updated>2017-11-11T13:46:20Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-11-07T13:58:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=eb50fd3a22c770f36be275295b782f3ea52e3215'/>
<id>urn:sha1:eb50fd3a22c770f36be275295b782f3ea52e3215</id>
<content type='text'>
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/staging/greybus files files with the correct SPDX
license identifier based on the license text in the file itself.  The
SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Vaibhav Hiremath &lt;hvaibhav.linux@gmail.com&gt;
Cc: "Bryan O'Donoghue" &lt;pure.logic@nexus-software.ie&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Cc: Philippe Ombredanne &lt;pombredanne@nexb.com&gt;
Acked-by: Vaibhav Agarwal &lt;vaibhav.sr@gmail.com&gt;
Acked-by: David Lin &lt;dtwlin@gmail.com&gt;
Reviewed-by: Alex Elder &lt;elder@linaro.org&gt;
Acked-by: Johan Hovold &lt;johan@kernel.org&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Acked-by: Mark Greer &lt;mgreer@animalcreek.com&gt;
Acked-by: Rui Miguel Silva &lt;rmfrfs@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: greybus: light: remove unnecessary error check</title>
<updated>2017-09-29T13:39:22Z</updated>
<author>
<name>Arvind Yadav</name>
<email>arvind.yadav.cs@gmail.com</email>
</author>
<published>2017-09-23T08:09:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1cd5929ab675b285e2179ec33cb0fef185aaabd1'/>
<id>urn:sha1:1cd5929ab675b285e2179ec33cb0fef185aaabd1</id>
<content type='text'>
It is not necessary to check return value of gb_lights_channel_flash_config.
gb_lights_channel_config returns both successful and error value.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Reviewed-by: Rui Miguel Silva &lt;rmfrfs@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>staging: greybus: light: Release memory obtained by kasprintf</title>
<updated>2017-09-29T13:39:22Z</updated>
<author>
<name>Arvind Yadav</name>
<email>arvind.yadav.cs@gmail.com</email>
</author>
<published>2017-09-23T07:55:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=04820da21050b35eed68aa046115d810163ead0c'/>
<id>urn:sha1:04820da21050b35eed68aa046115d810163ead0c</id>
<content type='text'>
Free memory region, if gb_lights_channel_config is not successful.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Reviewed-by: Rui Miguel Silva &lt;rmfrfs@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>media: v4l2-flash-led-class: Create separate sub-devices for indicators</title>
<updated>2017-08-27T00:26:35Z</updated>
<author>
<name>Sakari Ailus</name>
<email>sakari.ailus@linux.intel.com</email>
</author>
<published>2017-07-18T13:26:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=503dd28af108888c505e8d6a86f4acf5eb20f3b7'/>
<id>urn:sha1:503dd28af108888c505e8d6a86f4acf5eb20f3b7</id>
<content type='text'>
The V4L2 flash interface allows controlling multiple LEDs through a single
sub-devices if, and only if, these LEDs are of different types. This
approach scales badly for flash controllers that drive multiple flash LEDs
or for LED specific associations. Essentially, the original assumption of a
LED driver chip that drives a single flash LED and an indicator LED is no
longer valid.

Address the matter by registering one sub-device per LED.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Reviewed-by: Rui Miguel Silva &lt;rmfrfs@gmail.com&gt; (for greybus/light)
Acked-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
<entry>
<title>media: staging: greybus: light: fix memory leak in v4l2 register</title>
<updated>2017-08-27T00:25:01Z</updated>
<author>
<name>Rui Miguel Silva</name>
<email>rmfrfs@gmail.com</email>
</author>
<published>2017-08-02T16:52:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=428359cbfe086f43cb84b7ab7b48e7e7862700e2'/>
<id>urn:sha1:428359cbfe086f43cb84b7ab7b48e7e7862700e2</id>
<content type='text'>
We are allocating memory for the v4l2 flash configuration structure and
leak it in the normal path. Just use the stack for this as we do not
use it outside of this function.

Also use IS_ERR() instead of IS_ERR_OR_NULL() to check return value from
v4l2_flash_init() for it never returns NULL.

Fixes: 2870b52bae4c ("greybus: lights: add lights implementation")

Reported-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Rui Miguel Silva &lt;rmfrfs@gmail.com&gt;
Reviewed-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Acked-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@s-opensource.com&gt;
</content>
</entry>
</feed>
