On Mon, Mar 03, 2014 at 06:10:38PM +0100, Johannes Berg wrote: > Hi Dan, > > I keep getting this warning > > net/wireless/nl80211.c:2771 nl80211_get_key() warn: can 'mac_addr' even > be NULL? > > in some way or another all the time with smatch, and I'm wondering why > it pops up here? > > The variable in question ("mac_addr") starts out as being NULL, and the > bool variable "pairwise" in the if that smatch looks at is set to !! > mac_addr, but there's another code path that can set pairwise to true > even when mac_addr remains NULL, so I don't really understand the > warning. > > Am I missing something, or is that some sort of limitation in the smatch > logic? It's a bug in Smatch. For some reason it thinks that if pairwise is true that implies that mac_addr came from nla_data(). But pairwise also could be true if info->attrs[NL80211_ATTR_KEY_TYPE] is NL80211_KEYTYPE_PAIRWISE. It's a bug in smatch_implied.c. I'll try figure it out. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe smatch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html