Showing error 1830

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/net/wireless/hostap/hostap_ioctl.c
Line in file: 211
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

 181
 182                /* take WEP into use */
 183                new_crypt = kzalloc(sizeof(struct ieee80211_crypt_data),
 184                                GFP_KERNEL);
 185                if (new_crypt == NULL)
 186                        return -ENOMEM;
 187                new_crypt->ops = ieee80211_get_crypto_ops("WEP");
 188                if (!new_crypt->ops) {
 189                        request_module("ieee80211_crypt_wep");
 190                        new_crypt->ops = ieee80211_get_crypto_ops("WEP");
 191                }
 192                if (new_crypt->ops)
 193                        new_crypt->priv = new_crypt->ops->init(i);
 194                if (!new_crypt->ops || !new_crypt->priv) {
 195                        kfree(new_crypt);
 196                        new_crypt = NULL;
 197
 198                        printk(KERN_WARNING "%s: could not initialize WEP: "
 199                               "load module hostap_crypt_wep.o\n",
 200                               dev->name);
 201                        return -EOPNOTSUPP;
 202                }
 203                *crypt = new_crypt;
 204        }
 205
 206        if (erq->length > 0) {
 207                int len = erq->length <= 5 ? 5 : 13;
 208                int first = 1, j;
 209                if (len > erq->length)
 210                        memset(keybuf + erq->length, 0, len - erq->length);
 211                (*crypt)->ops->set_key(keybuf, len, NULL, (*crypt)->priv);
 212                for (j = 0; j < WEP_KEYS; j++) {
 213                        if (j != i && local->crypt[j]) {
 214                                first = 0;
 215                                break;
 216                        }
 217                }
 218                if (first)
 219                        local->tx_keyidx = i;
 220        } else {
 221                /* No key data - just set the default TX key index */
Show full sources