USB: Avoid NULL pointer deref in usb_hcd_alloc_bandwidth.

commit 8a9af4fdf6d5eeb3200a088354d266a87e8260b0 upstream.

usb_ifnum_to_if() can return NULL if the USB device does not have a
configuration installed (usb_device->actconfig == NULL), or if we can't
find the interface number in the installed configuration.  Return an
error instead of crashing.

Change-Id: Iaabd860608db48d9f0c57a46099908b6a7d64690
CRs-Fixed: 353339
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
Revert "Merge "Revert "ASoC: wcd9310: Fix headset detect..."" into msm-3.0"

This reverts commit 7646faf1a40035956809b4e6c54eb66fc0acc24e, reversing
changes made to 98b77c0f2f46ae9182169051c74c990ea80e5c5d.

Change-Id: Ic7ec3d0f75f37feaf42ec6adf0c0a4bdf03888e0
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
(cherry picked from commit 4195672d58b8e89db0defad8f3951a653e0e812e)
msm: fix vfe stop sequence.

Fix sequence of register writes during vfe stop. The interrupts
need to be disabled before CAMIF is stopped and AXI
needs to be halted. This ensures that there are no spurious
interrupts.

Change-Id: I3a6813d6cdd2f722fd72b3654fd66fe9721310c8
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
msm: fix mount angle for preview in external sensor

The mount angle for external imx sensor should be
180 degrees.

Change-Id: I7198a3f1dfc308ffe714f22c9c7887b7a4801fef
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
msm: 8960: Remove IOMMU support

Disable iommu support for now until all features have
been verified

Change-Id: Ice5462090b6b1275c6c1ef51afdb0d97a539ef29
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: bam_dmux: fix downlink data race condition

As soon as downlink data buffers are queued to the bam hardware, they can
be used.  Not all of the steps necessary to enable complete processing
of downlink data are completed when buffers are first queued.  This
creates a race condition where bam_dmux could attempt to process data
before it is ready.  Move the buffer queuing process to later when data
processing requirements are met, thus eliminating the race condition.

CRs-Fixed: 338616
Change-Id: I61b1bac5b66cd178141080d04907e742c9d9f81a
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
(cherry picked from commit 2fb555e25e9e9f4facab1cd8a5f02edab7e93dd5)
nl80211: advertise device AP SME

Add the ability to advertise that the device contains the AP SME and
what features it can support.There are currently no features in the
bitmap -- probe response offload will be advertised by a few patches
Arik is working on now (who took over from Guy Eilam) and a device
with AP SME will typically implement and require response offload.

Change-Id: Ic8d75e4933d795d43a0c30df6ec187f4d0ab6d8c
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
(cherry picked from commit a86a02fb86538076001f9c23e491baaf776d56e7)
nl80211: Add probe response offload attribute

Notify user-space about probe-response offloading support in the driver.
A wiphy flag is used to indicate support and a bitmap of protocols
determines which protocols are supported.

Change-Id: I13b16c71449ab61f4308b6caa1cca35529f905b4
Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
Merge "msm: bam_dmux: fix downlink data race condition" into ics_chocolate
vidc: Add extra cases for error handling in vidc init

Currently error conditions are not handled properly
if failures occur during irq request or while creating
work queue. With this commit these error conditions
are properly handled.

Change-Id: I618ca5c2a4f6bd09a3edd164a7867a90a9ed9f9a
CRs-Fixed: 355753
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
(cherry picked from commit c9a9332a743459e44744e630f3e734e7788c477d)
Bluetooth: Change locking function for process context code

Code executing in process context should use hci_dev_lock_bh()
and hci_dev_unlock_bh() instead of hci_dev_lock/hci_dev_unlock
when dealing with the hci_dev lock so that it cannot be
interrupted while the lock is held.

Change-Id: Iebc2da96837db29ab4911b0429399e3e9ba4b93e
CRs-fixed: 350532
Signed-off-by: Archana Ramachandran <archanar@codeaurora.org>
(cherry picked from commit f32d982aa5f8eb55304505a36602879c93766068)
msm: rmnet_sdio: Handle Network TX Queue Race Condition

The netif TX queue is started and stopped based upon the watermark state
maintained by SDIO DMUX.  The queue is checked after TX-enqueue
operations to disable the queue if the high watermark is hit and after
TX-dequeue operations to enable the queue if the low watermark is hit.

Without locking, this opens a race condition where the TX-dequeue check
and the call to stop the queue can happen after the write-done
completion has occurred which would restart the queue.  This results in
the queue being stopped indefinitely which results in a permanent data
stall.

CRs-Fixed: 354334
Change-Id: Id4d96c9216e921bf3179175bd1b1cfd39403a3d2
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
(cherry picked from commit b3a45d33b3b46853f3edcd5aea4bf56d7e97ec2e)
vidc: Send port reconfiguration for interlaced clips.

Component is not getting port reconfiguration request
from driver for an interlaced clip. Fix it by
modifying the condition for triggering the
reconfiguration request.

CRs-Fixed: 352456
Change-Id: I65ce5987f31915f45a13767965918b61e32db7a7
Signed-off-by: Rajeshwar Kurapaty <rkurapat@codeaurora.org>
(cherry picked from commit c264eed1e7debb50c97159784307de23bdfc3a3b)
mmc: msm_sdcc: print DML registers during SDCC errors

When SDCC driver encounters errors, it prints out the SDCC core
registers dump. But at times (say SPS BAM is stuck), SDCC core
register dump alone doesn't give much information.

So this patch also prints the DML (Data Mover Local HW which connects
SDCC controller to SPS-BAM HW) register dump if BAM is busy when
SDCC error is encountered.

Change-Id: If143e9225b40d49268600b50c83e7158f00cc79c
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
(cherry picked from commit 8ce4d2c6b3e8d6c82a6476380bbbfb54d78214b3)
Merge changes I13b16c71,Ic8d75e49 into ics_chocolate

* changes:
  nl80211: Add probe response offload attribute
  nl80211: advertise device AP SME
Merge "vidc: Add extra cases for error handling in vidc init" into ics_chocolate
Merge "vidc: Send port reconfiguration for interlaced clips." into ics_chocolate
Merge "Bluetooth: Change locking function for process context code" into ics_chocolate
Merge "msm: rmnet_sdio: Handle Network TX Queue Race Condition" into ics_chocolate
Merge "mmc: msm_sdcc: print DML registers during SDCC errors" into ics_chocolate