Revert "ANDROID: usb: typec: ucsi: Ensure bounds check when accessing src_pdos"
This reverts commit cd04f7fab9.
It will be fixed "properly" with an upstream patch later on in this
series, so revert it now so that it does not cause conflicts with the
upstream commit.
Bug: 186400956
Cc: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I111e570ce5e2447c639723430e86c98c040171b1
This commit is contained in:
parent
167612c1d4
commit
b73471e4e7
1 changed files with 3 additions and 3 deletions
|
|
@ -69,7 +69,7 @@ static int ucsi_psy_get_voltage_max(struct ucsi_connector *con,
|
|||
|
||||
switch (UCSI_CONSTAT_PWR_OPMODE(con->status.flags)) {
|
||||
case UCSI_CONSTAT_PWR_OPMODE_PD:
|
||||
if (con->num_pdos > 0 && con->num_pdos <= UCSI_MAX_PDOS) {
|
||||
if (con->num_pdos > 0) {
|
||||
pdo = con->src_pdos[con->num_pdos - 1];
|
||||
val->intval = pdo_fixed_voltage(pdo) * 1000;
|
||||
} else {
|
||||
|
|
@ -98,7 +98,7 @@ static int ucsi_psy_get_voltage_now(struct ucsi_connector *con,
|
|||
switch (UCSI_CONSTAT_PWR_OPMODE(con->status.flags)) {
|
||||
case UCSI_CONSTAT_PWR_OPMODE_PD:
|
||||
index = rdo_index(con->rdo);
|
||||
if (index > 0 && index <= UCSI_MAX_PDOS) {
|
||||
if (index > 0) {
|
||||
pdo = con->src_pdos[index - 1];
|
||||
val->intval = pdo_fixed_voltage(pdo) * 1000;
|
||||
} else {
|
||||
|
|
@ -125,7 +125,7 @@ static int ucsi_psy_get_current_max(struct ucsi_connector *con,
|
|||
|
||||
switch (UCSI_CONSTAT_PWR_OPMODE(con->status.flags)) {
|
||||
case UCSI_CONSTAT_PWR_OPMODE_PD:
|
||||
if (con->num_pdos > 0 && con->num_pdos <= UCSI_MAX_PDOS) {
|
||||
if (con->num_pdos > 0) {
|
||||
pdo = con->src_pdos[con->num_pdos - 1];
|
||||
val->intval = pdo_max_current(pdo) * 1000;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue