From: Lorenzo Bianconi Date: Mon, 4 Apr 2022 08:08:10 +0000 (+0200) Subject: mt76: mt7915: fix possible uninitialized pointer dereference in mt7986_wmac_gpio_setup X-Git-Tag: v6.6.17~7459^2~59^2~20^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9bd6823f5a64b6465708b244eecc9b7dd4b01bfc;p=platform%2Fkernel%2Flinux-rpi.git mt76: mt7915: fix possible uninitialized pointer dereference in mt7986_wmac_gpio_setup Add default case for type switch in mt7986_wmac_gpio_setup routine in order to avoid a possible uninitialized pointer dereference. Fixes: 99ad32a4ca3a2 ("mt76: mt7915: add support for MT7986") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau --- diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c index 52fc5d5bf20f..04e62d569599 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/soc.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/soc.c @@ -210,6 +210,8 @@ static int mt7986_wmac_gpio_setup(struct mt7915_dev *dev) if (IS_ERR_OR_NULL(state)) return -EINVAL; break; + default: + return -EINVAL; } ret = pinctrl_select_state(pinctrl, state);