usb: phy: phy-msm-usb: Fix usage of devm_regulator_bulk_get()
authorRajendra Nayak <rnayak@codeaurora.org>
Wed, 2 Aug 2017 07:45:42 +0000 (13:15 +0530)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 3 Aug 2017 09:32:13 +0000 (12:32 +0300)
commit5a8141bd41f0e7f7758956e2340e10cdf5f2b0b9
tree857007257b032cabe922a0c8fc35faa8cb42180a
parentaca5b9ebd096039657417c321a9252c696b359c2
usb: phy: phy-msm-usb: Fix usage of devm_regulator_bulk_get()

The regulator_bulk_data pointer passed to devm_regulator_bulk_get()
is used to store the client handles for the regulators, which
is later used by devm_regulator_bulk_release() to free the
regulators.
Passing a local array as is done here means the memory used to
store the handles is freed causing the handles to be corrupted,
resulting in a crash when devm_regulator_bulk_release() tries to
free them.

Fix this my moving the array inside of the msm_otg structure.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/phy/phy-msm-usb.c