MLK-20205-3: regulator: core: fix modulo by zero
Fix 'Division or modulo by zero' coverity issue(CID-4159438). In fact, no need to call set_ramp_delay() in case of ramp_disable is true, hence, ramp_delay never be 0 while set_ramp_delay() called. Signed-off-by: Robin Gong <yibin.gong@nxp.com> Reviewed-by: Anson Huang <Anson.Huang@nxp.com>pull/10/head
parent
e4dfaaa9c3
commit
9e06f5c227
|
@ -1099,7 +1099,7 @@ static int set_machine_constraints(struct regulator_dev *rdev,
|
|||
}
|
||||
}
|
||||
|
||||
if ((rdev->constraints->ramp_delay || rdev->constraints->ramp_disable)
|
||||
if ((rdev->constraints->ramp_delay && !rdev->constraints->ramp_disable)
|
||||
&& ops->set_ramp_delay) {
|
||||
ret = ops->set_ramp_delay(rdev, rdev->constraints->ramp_delay);
|
||||
if (ret < 0) {
|
||||
|
|
Loading…
Reference in New Issue