Changeset 4122
- Timestamp:
- 03/13/10 00:59:02 (2 years ago)
- Files:
-
- madwifi/trunk/regression/ccmp/test_ccmp.c (modified) (2 diffs)
- madwifi/trunk/regression/tkip/test_tkip.c (modified) (2 diffs)
- madwifi/trunk/regression/wep/test_wep.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
madwifi/trunk/regression/ccmp/test_ccmp.c
r3846 r4122 714 714 init_crypto_ccmp_test(void) 715 715 { 716 struct ieee80211com *ic; 716 struct { 717 struct ieee80211vap vap; 718 struct ieee80211com ic; 719 struct net_device netdev; 720 } *buf; 717 721 struct ieee80211vap *vap; 718 722 int i, pass, total; 719 723 720 ic = kzalloc(sizeof(*ic), GFP_KERNEL);721 if (! ic)724 buf = kzalloc(sizeof(*buf), GFP_KERNEL); 725 if (!buf) 722 726 return -ENOMEM; 723 727 724 ieee80211_crypto_attach(ic); 725 726 vap = kzalloc(sizeof(*vap), GFP_KERNEL); 727 if (!vap) { 728 kfree(ic); 729 return -ENOMEM; 730 } 731 732 vap->iv_ic = ic; 728 vap = &buf->vap; 729 vap->iv_ic = &buf->ic; 730 vap->iv_dev = &buf->netdev; 731 vap->iv_ic->ic_dev = vap->iv_dev; 732 strncpy(vap->iv_dev->name, "CCMP test", sizeof(vap->iv_dev->name) - 1); 733 733 734 if (debug) 734 735 vap->iv_debug = IEEE80211_MSG_CRYPTO; 735 736 737 ieee80211_crypto_attach(vap->iv_ic); 736 738 ieee80211_crypto_vattach(vap); 737 739 … … 745 747 printk("%u of %u 802.11i AES-CCMP test vectors passed\n", pass, total); 746 748 ieee80211_crypto_vdetach(vap); 747 ieee80211_crypto_detach(ic); 748 kfree(vap); 749 kfree(ic); 749 ieee80211_crypto_detach(vap->iv_ic); 750 kfree(buf); 750 751 return (pass == total ? 0 : -ENXIO); 751 752 } madwifi/trunk/regression/tkip/test_tkip.c
r3846 r4122 373 373 init_crypto_tkip_test(void) 374 374 { 375 struct ieee80211com *ic; 375 struct { 376 struct ieee80211vap vap; 377 struct ieee80211com ic; 378 struct net_device netdev; 379 } *buf; 376 380 struct ieee80211vap *vap; 377 381 int i, pass, total; 378 382 379 ic = kzalloc(sizeof(*ic), GFP_KERNEL);380 if (! ic)383 buf = kzalloc(sizeof(*buf), GFP_KERNEL); 384 if (!buf) 381 385 return -ENOMEM; 382 386 383 ieee80211_crypto_attach(ic); 384 385 vap = kzalloc(sizeof(*vap), GFP_KERNEL); 386 if (!vap) { 387 kfree(ic); 388 return -ENOMEM; 389 } 390 391 vap->iv_ic = ic; 387 vap = &buf->vap; 388 vap->iv_ic = &buf->ic; 389 vap->iv_dev = &buf->netdev; 390 vap->iv_ic->ic_dev = vap->iv_dev; 391 strncpy(vap->iv_dev->name, "TKIP test", sizeof(vap->iv_dev->name) - 1); 392 392 393 if (debug) 393 394 vap->iv_debug = IEEE80211_MSG_CRYPTO; 394 395 396 ieee80211_crypto_attach(vap->iv_ic); 395 397 ieee80211_crypto_vattach(vap); 396 398 … … 404 406 printk("%u of %u 802.11i TKIP test vectors passed\n", pass, total); 405 407 ieee80211_crypto_vdetach(vap); 406 ieee80211_crypto_detach(ic); 407 kfree(vap); 408 kfree(ic); 408 ieee80211_crypto_detach(vap->iv_ic); 409 kfree(buf); 409 410 return (pass == total ? 0 : -ENXIO); 410 411 } madwifi/trunk/regression/wep/test_wep.c
r3846 r4122 318 318 init_crypto_wep_test(void) 319 319 { 320 struct ieee80211com *ic; 320 struct { 321 struct ieee80211vap vap; 322 struct ieee80211com ic; 323 struct net_device netdev; 324 } *buf; 321 325 struct ieee80211vap *vap; 322 326 int i, pass, total; 323 327 324 ic = kzalloc(sizeof(*ic), GFP_KERNEL);325 if (! ic)328 buf = kzalloc(sizeof(*buf), GFP_KERNEL); 329 if (!buf) 326 330 return -ENOMEM; 327 331 328 ieee80211_crypto_attach(ic); 329 330 vap = kzalloc(sizeof(*vap), GFP_KERNEL); 331 if (!vap) { 332 kfree(ic); 333 return -ENOMEM; 334 } 335 336 vap->iv_ic = ic; 332 vap = &buf->vap; 333 vap->iv_ic = &buf->ic; 334 vap->iv_dev = &buf->netdev; 335 vap->iv_ic->ic_dev = vap->iv_dev; 336 strncpy(vap->iv_dev->name, "WEP test", sizeof(vap->iv_dev->name) - 1); 337 337 338 if (debug) 338 339 vap->iv_debug = IEEE80211_MSG_CRYPTO; 339 340 341 ieee80211_crypto_attach(vap->iv_ic); 340 342 ieee80211_crypto_vattach(vap); 341 343 … … 349 351 printk("%u of %u 802.11i WEP test vectors passed\n", pass, total); 350 352 ieee80211_crypto_vdetach(vap); 351 ieee80211_crypto_detach(ic); 352 kfree(vap); 353 kfree(ic); 353 ieee80211_crypto_detach(vap->iv_ic); 354 kfree(buf); 354 355 return (pass == total ? 0 : -ENXIO); 355 356 }
