Message ID | 20241115063835.5888-1-zichenxie0106@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [v2] wifi: cfg80211: tests: Fix potential NULL dereference in test_cfg80211_parse_colocated_ap() | expand |
diff --git a/net/wireless/tests/scan.c b/net/wireless/tests/scan.c index 9f458be71659..79a99cf5e892 100644 --- a/net/wireless/tests/scan.c +++ b/net/wireless/tests/scan.c @@ -810,6 +810,8 @@ static void test_cfg80211_parse_colocated_ap(struct kunit *test) skb_put_data(input, "123", 3); ies = kunit_kzalloc(test, struct_size(ies, data, input->len), GFP_KERNEL); + KUNIT_ASSERT_NOT_NULL(test, ies); + ies->len = input->len; memcpy(ies->data, input->data, input->len);