Commit 01318bc0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Felix Fietkau

mt76: mt7915: check for devm_pinctrl_get() failure

If devm_pinctrl_get() fails then it leads to an error pointer
dereference.  Add a check to prevent that.

Fixes: 99ad32a4 ("mt76: mt7915: add support for MT7986")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 9a657684
...@@ -196,6 +196,8 @@ static int mt7986_wmac_gpio_setup(struct mt7915_dev *dev) ...@@ -196,6 +196,8 @@ static int mt7986_wmac_gpio_setup(struct mt7915_dev *dev)
type = mt7986_wmac_check_adie_type(dev); type = mt7986_wmac_check_adie_type(dev);
pinctrl = devm_pinctrl_get(dev->mt76.dev); pinctrl = devm_pinctrl_get(dev->mt76.dev);
if (IS_ERR(pinctrl))
return PTR_ERR(pinctrl);
switch (type) { switch (type) {
case ADIE_SB: case ADIE_SB:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment