Print this page
5253 kmem_alloc/kmem_zalloc won't fail with KM_SLEEP
5254 getrbuf won't fail with KM_SLEEP


  70         IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN +
  71             IEEE80211_WEP_EXTIVLEN,
  72         IEEE80211_WEP_MICLEN,
  73         0,
  74         ccmp_attach,
  75         ccmp_detach,
  76         ccmp_setkey,
  77         ccmp_encap,
  78         ccmp_decap,
  79         ccmp_enmic,
  80         ccmp_demic,
  81 };
  82 
  83 /* ARGSUSED */
  84 static void *
  85 ccmp_attach(struct ieee80211com *ic, struct ieee80211_key *k)
  86 {
  87         struct ccmp_ctx *ctx;
  88 
  89         ctx = kmem_zalloc(sizeof (struct ccmp_ctx), KM_SLEEP);
  90         if (ctx == NULL)
  91                 return (NULL);
  92 
  93         ctx->cc_ic = ic;
  94         return (ctx);
  95 }
  96 
  97 static void
  98 ccmp_detach(struct ieee80211_key *k)
  99 {
 100         struct ccmp_ctx *ctx = k->wk_private;
 101 
 102         if (ctx != NULL)
 103                 kmem_free(ctx, sizeof (struct ccmp_ctx));
 104 }
 105 
 106 static int
 107 ccmp_setkey(struct ieee80211_key *k)
 108 {
 109         if (k->wk_keylen != (128/NBBY))
 110                 return (0);
 111 




  70         IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN +
  71             IEEE80211_WEP_EXTIVLEN,
  72         IEEE80211_WEP_MICLEN,
  73         0,
  74         ccmp_attach,
  75         ccmp_detach,
  76         ccmp_setkey,
  77         ccmp_encap,
  78         ccmp_decap,
  79         ccmp_enmic,
  80         ccmp_demic,
  81 };
  82 
  83 /* ARGSUSED */
  84 static void *
  85 ccmp_attach(struct ieee80211com *ic, struct ieee80211_key *k)
  86 {
  87         struct ccmp_ctx *ctx;
  88 
  89         ctx = kmem_zalloc(sizeof (struct ccmp_ctx), KM_SLEEP);


  90 
  91         ctx->cc_ic = ic;
  92         return (ctx);
  93 }
  94 
  95 static void
  96 ccmp_detach(struct ieee80211_key *k)
  97 {
  98         struct ccmp_ctx *ctx = k->wk_private;
  99 
 100         if (ctx != NULL)
 101                 kmem_free(ctx, sizeof (struct ccmp_ctx));
 102 }
 103 
 104 static int
 105 ccmp_setkey(struct ieee80211_key *k)
 106 {
 107         if (k->wk_keylen != (128/NBBY))
 108                 return (0);
 109