Merge commit 'v3.17' into next
[firefly-linux-kernel-4.4.55.git] / fs / cifs / cifs_spnego.c
index 10e7747612992bcc25706851c9027762e2fc134d..f4cf200b3c76714ca5a059b1ecdcca6f2e77b338 100644 (file)
@@ -37,12 +37,11 @@ cifs_spnego_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
        int ret;
 
        ret = -ENOMEM;
-       payload = kmalloc(prep->datalen, GFP_KERNEL);
+       payload = kmemdup(prep->data, prep->datalen, GFP_KERNEL);
        if (!payload)
                goto error;
 
        /* attach the data */
-       memcpy(payload, prep->data, prep->datalen);
        key->payload.data = payload;
        ret = 0;
 
@@ -63,7 +62,6 @@ cifs_spnego_key_destroy(struct key *key)
 struct key_type cifs_spnego_key_type = {
        .name           = "cifs.spnego",
        .instantiate    = cifs_spnego_key_instantiate,
-       .match          = user_match,
        .destroy        = cifs_spnego_key_destroy,
        .describe       = user_describe,
 };
@@ -164,7 +162,7 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)
        dp = description + strlen(description);
        sprintf(dp, ";pid=0x%x", current->pid);
 
-       cFYI(1, "key description = %s", description);
+       cifs_dbg(FYI, "key description = %s\n", description);
        spnego_key = request_key(&cifs_spnego_key_type, description, "");
 
 #ifdef CONFIG_CIFS_DEBUG2