From: Ola Olsson Date: Mon, 9 Nov 2015 21:02:09 +0000 (+0100) Subject: cfg80211: ocb: Fix null pointer deref if join_ocb is unimplemented X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1b9df2d20eee9f3a675d1a3a7aa3640e6d8d7e94;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git cfg80211: ocb: Fix null pointer deref if join_ocb is unimplemented Signed-off-by: Ola Olsson Signed-off-by: Johannes Berg --- diff --git a/net/wireless/ocb.c b/net/wireless/ocb.c index c00d4a792319..e64dbf16330c 100644 --- a/net/wireless/ocb.c +++ b/net/wireless/ocb.c @@ -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;