summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/boot/dts/qcom/msm8996-cdp.dtsi4
-rw-r--r--arch/arm/boot/dts/qcom/msm8996-mtp.dtsi4
-rw-r--r--arch/arm/boot/dts/qcom/msm8996.dtsi1
-rw-r--r--drivers/platform/msm/ipa/ipa_rm_dependency_graph.c8
-rw-r--r--drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c19
-rw-r--r--drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c19
-rw-r--r--drivers/power/supply/qcom/qpnp-smbcharger.c4
-rw-r--r--drivers/usb/phy/phy-msm-ssusb-qmp.c20
8 files changed, 60 insertions, 19 deletions
diff --git a/arch/arm/boot/dts/qcom/msm8996-cdp.dtsi b/arch/arm/boot/dts/qcom/msm8996-cdp.dtsi
index 3988953f6963..968d5190a8d3 100644
--- a/arch/arm/boot/dts/qcom/msm8996-cdp.dtsi
+++ b/arch/arm/boot/dts/qcom/msm8996-cdp.dtsi
@@ -790,6 +790,10 @@
qcom,check-for-float;
};
+&qusb_phy0 {
+ qcom,enable-dpdm-pulsing;
+};
+
&usb2s {
status = "disabled";
dwc3@7600000 {
diff --git a/arch/arm/boot/dts/qcom/msm8996-mtp.dtsi b/arch/arm/boot/dts/qcom/msm8996-mtp.dtsi
index 38f3715973cd..f923d70848ce 100644
--- a/arch/arm/boot/dts/qcom/msm8996-mtp.dtsi
+++ b/arch/arm/boot/dts/qcom/msm8996-mtp.dtsi
@@ -514,6 +514,10 @@
qcom,check-for-float;
};
+&qusb_phy0 {
+ qcom,enable-dpdm-pulsing;
+};
+
&i2c_7 {
smb1351-charger@1d {
compatible = "qcom,smb1351-charger";
diff --git a/arch/arm/boot/dts/qcom/msm8996.dtsi b/arch/arm/boot/dts/qcom/msm8996.dtsi
index fd49714e2a5c..62abceb7b5b1 100644
--- a/arch/arm/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm/boot/dts/qcom/msm8996.dtsi
@@ -2177,7 +2177,6 @@
phy_type= "utmi";
qcom,phy-clk-scheme = "cmos";
qcom,major-rev = <1>;
- qcom,enable-dpdm-pulsing;
clocks = <&clock_gcc clk_gcc_usb_phy_cfg_ahb2phy_clk>,
<&clock_gcc clk_ln_bb_clk>;
diff --git a/drivers/platform/msm/ipa/ipa_rm_dependency_graph.c b/drivers/platform/msm/ipa/ipa_rm_dependency_graph.c
index e10c75a473ce..f5c36fed5ede 100644
--- a/drivers/platform/msm/ipa/ipa_rm_dependency_graph.c
+++ b/drivers/platform/msm/ipa/ipa_rm_dependency_graph.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -88,7 +88,8 @@ int ipa_rm_dep_graph_get_resource(
goto bail;
}
resource_index = ipa_rm_dep_get_index(resource_name);
- if (resource_index == IPA_RM_INDEX_INVALID) {
+ if (resource_index == IPA_RM_INDEX_INVALID ||
+ resource_index >= IPA_RM_RESOURCE_MAX) {
result = -EINVAL;
goto bail;
}
@@ -120,7 +121,8 @@ int ipa_rm_dep_graph_add(struct ipa_rm_dep_graph *graph,
goto bail;
}
resource_index = ipa_rm_dep_get_index(resource->name);
- if (resource_index == IPA_RM_INDEX_INVALID) {
+ if (resource_index == IPA_RM_INDEX_INVALID ||
+ resource_index >= IPA_RM_RESOURCE_MAX) {
result = -EINVAL;
goto bail;
}
diff --git a/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c
index e80d3ad93afe..7518e437acd2 100644
--- a/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c
+++ b/drivers/platform/msm/ipa/ipa_v2/rmnet_ipa.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -2887,6 +2887,15 @@ int rmnet_ipa_query_tethering_stats_modem(
struct ipa_get_data_stats_resp_msg_v01 *resp;
int pipe_len, rc;
+ if (data != NULL) {
+ /* prevent string buffer overflows */
+ data->upstreamIface[IFNAMSIZ-1] = '\0';
+ data->tetherIface[IFNAMSIZ-1] = '\0';
+ } else if (reset != false) {
+ /* Data can be NULL for reset stats, checking reset != False */
+ return -EINVAL;
+ }
+
req = kzalloc(sizeof(struct ipa_get_data_stats_req_msg_v01),
GFP_KERNEL);
if (!req) {
@@ -2910,7 +2919,13 @@ int rmnet_ipa_query_tethering_stats_modem(
IPAWANDBG("reset the pipe stats\n");
} else {
/* print tethered-client enum */
- IPAWANDBG("Tethered-client enum(%d)\n", data->ipa_client);
+ if (data == NULL) {
+ kfree(req);
+ kfree(resp);
+ return -EINVAL;
+ }
+ IPAWANDBG_LOW("Tethered-client enum(%d)\n",
+ data->ipa_client);
}
rc = ipa_qmi_get_data_stats(req, resp);
diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
index 656b95316895..cccd597646a7 100644
--- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
+++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -3001,6 +3001,15 @@ static int rmnet_ipa3_query_tethering_stats_modem(
struct ipa_get_data_stats_resp_msg_v01 *resp;
int pipe_len, rc;
+ if (data != NULL) {
+ /* prevent string buffer overflows */
+ data->upstreamIface[IFNAMSIZ-1] = '\0';
+ data->tetherIface[IFNAMSIZ-1] = '\0';
+ } else if (reset != false) {
+ /* Data can be NULL for reset stats, checking reset != False */
+ return -EINVAL;
+ }
+
req = kzalloc(sizeof(struct ipa_get_data_stats_req_msg_v01),
GFP_KERNEL);
if (!req) {
@@ -3024,7 +3033,13 @@ static int rmnet_ipa3_query_tethering_stats_modem(
IPAWANDBG("reset the pipe stats\n");
} else {
/* print tethered-client enum */
- IPAWANDBG("Tethered-client enum(%d)\n", data->ipa_client);
+ if (data == NULL) {
+ kfree(req);
+ kfree(resp);
+ return -EINVAL;
+ }
+ IPAWANDBG_LOW("Tethered-client enum(%d)\n",
+ data->ipa_client);
}
rc = ipa3_qmi_get_data_stats(req, resp);
diff --git a/drivers/power/supply/qcom/qpnp-smbcharger.c b/drivers/power/supply/qcom/qpnp-smbcharger.c
index 2ebefb072685..819c002ae0fc 100644
--- a/drivers/power/supply/qcom/qpnp-smbcharger.c
+++ b/drivers/power/supply/qcom/qpnp-smbcharger.c
@@ -4805,10 +4805,10 @@ static void handle_usb_insertion(struct smbchg_chip *chip)
/* Only notify USB if it's not a charger */
if (usb_supply_type == POWER_SUPPLY_TYPE_USB ||
usb_supply_type == POWER_SUPPLY_TYPE_USB_CDP) {
- extcon_set_cable_state_(chip->extcon, EXTCON_USB,
- chip->usb_present);
extcon_set_cable_state_(chip->extcon, EXTCON_USB_SPEED,
chip->usb_present);
+ extcon_set_cable_state_(chip->extcon, EXTCON_USB,
+ chip->usb_present);
}
/* Notify the USB psy if OV condition is not present */
if (!chip->usb_ov_det) {
diff --git a/drivers/usb/phy/phy-msm-ssusb-qmp.c b/drivers/usb/phy/phy-msm-ssusb-qmp.c
index d1b6f1df860d..8cfbb1c100fe 100644
--- a/drivers/usb/phy/phy-msm-ssusb-qmp.c
+++ b/drivers/usb/phy/phy-msm-ssusb-qmp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -484,14 +484,16 @@ static int msm_ssphy_qmp_set_suspend(struct usb_phy *uphy, int suspend)
/* Make sure above write completed with PHY */
wmb();
- clk_disable_unprepare(phy->cfg_ahb_clk);
- clk_disable_unprepare(phy->aux_clk);
- clk_disable_unprepare(phy->pipe_clk);
- if (phy->ref_clk)
- clk_disable_unprepare(phy->ref_clk);
- if (phy->ref_clk_src)
- clk_disable_unprepare(phy->ref_clk_src);
- phy->clk_enabled = false;
+ if (phy->clk_enabled) {
+ clk_disable_unprepare(phy->cfg_ahb_clk);
+ clk_disable_unprepare(phy->aux_clk);
+ clk_disable_unprepare(phy->pipe_clk);
+ if (phy->ref_clk)
+ clk_disable_unprepare(phy->ref_clk);
+ if (phy->ref_clk_src)
+ clk_disable_unprepare(phy->ref_clk_src);
+ phy->clk_enabled = false;
+ }
phy->in_suspend = true;
msm_ssphy_power_enable(phy, 0);
dev_dbg(uphy->dev, "QMP PHY is suspend\n");