cfg80211: ocb: Fix null pointer deref if join_ocb is unimplemented
authorOla Olsson <ola1olsson@gmail.com>
Mon, 9 Nov 2015 21:02:09 +0000 (22:02 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 4 Dec 2015 13:43:32 +0000 (14:43 +0100)
Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/ocb.c

index c00d4a792319f4a25c9a07cd431d8f7b943ec5e2..e64dbf16330c4f52f89146bc3e9096958a4303ed 100644 (file)
@@ -29,6 +29,9 @@ int __cfg80211_join_ocb(struct cfg80211_registered_device *rdev,
        if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_OCB)
                return -EOPNOTSUPP;
 
+       if (!rdev->ops->join_ocb)
+               return -EOPNOTSUPP;
+
        if (WARN_ON(!setup->chandef.chan))
                return -EINVAL;