From: Peter Huewe Date: Thu, 14 Feb 2013 02:37:10 +0000 (+0100) Subject: staging/wlan-ng: Fix 'Branch condition evaluates to a garbage value' in p80211netdev.c X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=4ea24f0e267ab7667a802d18f91f1d611f16a526 staging/wlan-ng: Fix 'Branch condition evaluates to a garbage value' in p80211netdev.c commit fae7e4d39373305cf505d1f0871a4491897d56f9 upstream. clang/scan-build complains that: p80211netdev.c:451:6: warning: Branch condition evaluates to a garbage value if ((p80211_wep.data) && (p80211_wep.data != skb->data)) ^~~~~~~~~~~~~~~~~ This can happen in p80211knetdev_hard_start_xmit if - if (wlandev->state != WLAN_DEVICE_OPEN) evaluates to true. the execution flow then continues at the 'failed' label where p80211_wep.data is used without being initialized first. -> Initialize the data field to NULL to fix this issue. Signed-off-by: Peter Huewe Signed-off-by: Greg Kroah-Hartman Signed-off-by: Ben Hutchings --- diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 14bfeb2e704c..a8ca81e6f1d1 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -354,6 +354,8 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb, union p80211_hdr p80211_hdr; struct p80211_metawep p80211_wep; + p80211_wep.data = NULL; + if (skb == NULL) return NETDEV_TX_OK;