summaryrefslogtreecommitdiff
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-03-07 17:13:49 +0300
committerFelix Fietkau <nbd@nbd.name>2022-03-16 17:40:22 +0100
commit01318bc00d16947715e8f65a629806e5953a36ff (patch)
tree570b699ec56f60e05255247b1bcfe8696165aff7 /drivers/net/wireless
parent9a657684158f44d04845c770c1cfa57989fc2400 (diff)
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: 99ad32a4ca3a ("mt76: mt7915: add support for MT7986") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7915/soc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c
index 769874820f9b..3028c02cb840 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c
@@ -196,6 +196,8 @@ static int mt7986_wmac_gpio_setup(struct mt7915_dev *dev)
type = mt7986_wmac_check_adie_type(dev);
pinctrl = devm_pinctrl_get(dev->mt76.dev);
+ if (IS_ERR(pinctrl))
+ return PTR_ERR(pinctrl);
switch (type) {
case ADIE_SB: