Fix UAF where two threads can open and close the same file. Second
open will cause the private data for the first file to be overwritten.
When the first file is closed and the private data is freed, this makes
the now-shared private data OOB for the second thread.
CRs-Fixed: 1109763
Change-Id: I1c4618d5be99e140abf0f3ea0d7f485897db5ab2
Signed-off-by: Ankit Sharma <ansharma@codeaurora.org>
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
This reverts commit 5b289d3a64.
Bring back the flash driver for 8996.
Change-Id: I6232ff004fc790e41f73bdf9d90d5455b5cb8a55
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
leds-qpnp-flash driver is not supported anymore. Remove it.
Change-Id: Ie2f570bad8171c460b8167f140d71c052ada2b17
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
There is a possible race condition when debugfs files are concurrently
accessed by multiple threads. Fix this.
CRs-Fixed: 1109420, 1109326
Change-Id: I19e9107079ac8d039b12a37ae612727f824552d4
Signed-off-by: Ankit Sharma <ansharma@codeaurora.org>
Correct warnings flagged by checkpatch. In particular, modify
the following:
- Add 'const' to the type of a struct of_device_id variable.
- Use octal file permissions instead of symbolic.
- Remove unnecessary out-of-memory error messages.
- Use variable name in sizeof() for kzalloc() calls.
- Restructure conditionals to avoid else after return.
- Remove 'return' from the end of void functions.
- Correct the format of block comments.
- Correct the spelling of 'cannot'.
- Update the LEDS_QPNP_FLASH Kconfig entry to use the name
'Qualcomm Technologies, Inc.'
- Expand the description of the LEDS_QPNP_FLASH config
option.
Change-Id: I342fe2d0e6a027c87cd17a3697529b422ec49ab6
Signed-off-by: David Collins <collinsd@codeaurora.org>
Use the correct LED_OPTIONS mask to enable all the supported
flash prepare APIs.
CRs-Fixed: 1090029
Change-Id: I66f6de42b106fa2027285e7393b6f9fc143d00d8
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Update the flash prepare API to handle the DISABLE_REGULATOR
option, and include support to return the max_current value
in a parameter instead of the return value.
CRs-Fixed: 1043718
Change-Id: Ief86531658cd0e72ceeae062d29133d5505eb5cf
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
Add the flash_prepare API to the leds-qpnp-flash driver to
maintain consistent usage of the API by the camera flash driver
across targets.
CRs-Fixed: 1043718
Change-Id: I21cc4b4556b2a4a1a918bfeb1d55ae164d4b5568
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
LED switch node operations are invoked both from LED trigger framework
callback and LED work thread. As work thread and LED trigger framework
operations are asynchronous, a race condition occurs when back-to-back
operations happen. Therefore, moving LED switch node operations from
LED trigger framework callback to work thread to eliminate race condition.
Change-Id: Ia962f3aebda9162e3a35773ef3ee27a4434e6d0c
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
The open fault status flag depends on fault status register. However,
the register value is reset when LED module is disabled. In this
case, use OR logic to make sure the value is always set even if
module gets disabled.
Change-Id: If89f8fca25abc79d9d200d59031b8654f812105d
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
Fix some variable initializations which would otherwise cause
forbidden warnings.
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Replace all call sites which invoke the get/set_property apis on the
power_supply object with power_supply_get/set_property() api call.
Change-Id: Ibd4c5db6a50734f827878589df1f3e48a0062a06
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Change to using upstream spmi bus architecture. All the spmi devices,
marked by spmi-dev-container, become platform devices.
spmi-slave-container devices become spmi_devices each representing
a slave. The read/write functions use regmap api's instead of calls to
spmi_ext_register_read/write() implemented by the spmi bus. This
regmap is instantiated per slave.
The spmi bus helper functions like spmi_get_irq get changed to their
platform bus equivalents.
Change Kconfig files include
* Remove dependence on OF_SPMI, MSM_QPNP_INT
* There were few places where an earlier commit
dcc2aedc80746acee589e4b47d3e6adf5d3ec253
missed adding dependence on SPMI along with MSM_SPMI.
Fix them.
* Add depends on ARCH_MSM. ARCH_MSM is used for internal builds.
Change the nodes in DTSI files to confirm to the modified drivers.
Update their binding docs to drop spmi-dev-container and
spmi-slave-container;
Finally update defconfig to use upstream SPMI.
Change-Id: Ic85bff27c09c84b152cb38acbc3cadd05c0ec57a
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Pass the chip structure to masked write. This is in preparation
for the upcoming transition to being a platform device.
Change-Id: Ic98c9e80a526e4eadb4892505f6cd20d9e993040
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
This snapshot is taken as of msm-3.18 commit
9da4ddc (Merge "clk: msm: clock-gcc: Associate gfx rail
voting with gfx3d branch")
Change-Id: Idd2f467f1f1863a156d1757589dfe78158f0e43f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>