summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2013-12-05 15:20:49 +0800
committerPeter Chen <peter.chen@freescale.com>2014-01-16 16:56:10 +0800
commitadc3d94e7639d98ae70a4fa9c24d4a815544c8cb (patch)
treec090d95889fd1cb67921891394c375919deba6c4 /drivers
parentb2ab07435ff0bd81d4e6dccc75278b43c4e9cd1e (diff)
usb: chipidea: host: Only disable the vbus regulator if it is not NULL
Commit 40ed51a4b (usb: chipidea: host: add vbus regulator control) introduced a smatch complaint because regulator_disable() is called without checking whether ci->platdata->reg_vbus is not NULL. Fix this by adding the check. This patch is needed for 3.12 stable Cc: stable <stable@vger.kernel.org> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit ae93fad5728e08f7cde89f628be2703ad249930d)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/chipidea/host.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index 7e9d152c5563..ce3dc7345616 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -291,7 +291,8 @@ static int host_start(struct ci_hdrc *ci)
return ret;
disable_reg:
- regulator_disable(ci->platdata->reg_vbus);
+ if (ci->platdata->reg_vbus)
+ regulator_disable(ci->platdata->reg_vbus);
put_hcd:
usb_put_hcd(hcd);