Message ID | 20170920114754.E69A24400D3@finisterre.ee.mobilebroadband |
---|---|
State | Accepted |
Commit | a029ef45179d72945c7ae0a11f97e8012a5574ac |
Headers | show |
Series | Applied "ASoC: tas571x: Kill BUG_ON() usage" to the asoc tree | expand |
diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c index 810369f687d7..a09499977be4 100644 --- a/sound/soc/codecs/tas571x.c +++ b/sound/soc/codecs/tas571x.c @@ -697,7 +697,8 @@ static int tas571x_i2c_probe(struct i2c_client *client, return PTR_ERR(priv->mclk); } - BUG_ON(priv->chip->num_supply_names > TAS571X_MAX_SUPPLIES); + if (WARN_ON(priv->chip->num_supply_names > TAS571X_MAX_SUPPLIES)) + return -EINVAL; for (i = 0; i < priv->chip->num_supply_names; i++) priv->supplies[i].supply = priv->chip->supply_names[i];