crypto: ccp - Release all allocated memory if sha type is invalid
[linux-2.6-microblaze.git] / drivers / crypto / ccp / ccp-ops.c
index c8da8eb..4221936 100644 (file)
@@ -1777,8 +1777,9 @@ ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
                               LSB_ITEM_SIZE);
                        break;
                default:
+                       kfree(hmac_buf);
                        ret = -EINVAL;
-                       goto e_ctx;
+                       goto e_data;
                }
 
                memset(&hmac_cmd, 0, sizeof(hmac_cmd));