ubsan: disable UBSAN_TRAP for all*config
[linux-2.6-microblaze.git] / drivers / regulator / helpers.c
index e4bb09b..f42b394 100644 (file)
@@ -649,6 +649,8 @@ int regulator_list_voltage_table(struct regulator_dev *rdev,
 
        if (selector >= rdev->desc->n_voltages)
                return -EINVAL;
+       if (selector < rdev->desc->linear_min_sel)
+               return 0;
 
        return rdev->desc->volt_table[selector];
 }