2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-18 10:13:57 +08:00

regulator: qcom-rpm: signedness bug in probe()

"force_mode" is a u32 so it is never "< 0", but because of type
promotion then comparing "== -1" will do what we want.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Dan Carpenter 2015-01-28 22:15:31 +03:00 committed by Mark Brown
parent 97bf6af1f9
commit a412ec2795

View File

@ -768,7 +768,7 @@ static int rpm_reg_probe(struct platform_device *pdev)
break;
}
if (force_mode < 0) {
if (force_mode == -1) {
dev_err(&pdev->dev, "invalid force mode\n");
return -EINVAL;
}