diff options
-rw-r--r-- | net/sunrpc/auth_gss/gss_krb5_crypto.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_crypto.c b/net/sunrpc/auth_gss/gss_krb5_crypto.c index 97c981fa6b8e..76b969e6904f 100644 --- a/net/sunrpc/auth_gss/gss_krb5_crypto.c +++ b/net/sunrpc/auth_gss/gss_krb5_crypto.c | |||
@@ -212,7 +212,6 @@ make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, | |||
212 | char *cksumname; | 212 | char *cksumname; |
213 | struct crypto_tfm *tfm = NULL; /* XXX add to ctx? */ | 213 | struct crypto_tfm *tfm = NULL; /* XXX add to ctx? */ |
214 | struct scatterlist sg[1]; | 214 | struct scatterlist sg[1]; |
215 | u32 code = GSS_S_FAILURE; | ||
216 | 215 | ||
217 | switch (cksumtype) { | 216 | switch (cksumtype) { |
218 | case CKSUMTYPE_RSA_MD5: | 217 | case CKSUMTYPE_RSA_MD5: |
@@ -221,13 +220,11 @@ make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, | |||
221 | default: | 220 | default: |
222 | dprintk("RPC: krb5_make_checksum:" | 221 | dprintk("RPC: krb5_make_checksum:" |
223 | " unsupported checksum %d", cksumtype); | 222 | " unsupported checksum %d", cksumtype); |
224 | goto out; | 223 | return GSS_S_FAILURE; |
225 | } | 224 | } |
226 | if (!(tfm = crypto_alloc_tfm(cksumname, CRYPTO_TFM_REQ_MAY_SLEEP))) | 225 | if (!(tfm = crypto_alloc_tfm(cksumname, CRYPTO_TFM_REQ_MAY_SLEEP))) |
227 | goto out; | 226 | return GSS_S_FAILURE; |
228 | cksum->len = crypto_tfm_alg_digestsize(tfm); | 227 | cksum->len = crypto_tfm_alg_digestsize(tfm); |
229 | if ((cksum->data = kmalloc(cksum->len, GFP_KERNEL)) == NULL) | ||
230 | goto out; | ||
231 | 228 | ||
232 | crypto_digest_init(tfm); | 229 | crypto_digest_init(tfm); |
233 | sg_set_buf(sg, header, hdrlen); | 230 | sg_set_buf(sg, header, hdrlen); |
@@ -235,10 +232,8 @@ make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, | |||
235 | process_xdr_buf(body, body_offset, body->len - body_offset, | 232 | process_xdr_buf(body, body_offset, body->len - body_offset, |
236 | checksummer, tfm); | 233 | checksummer, tfm); |
237 | crypto_digest_final(tfm, cksum->data); | 234 | crypto_digest_final(tfm, cksum->data); |
238 | code = 0; | ||
239 | out: | ||
240 | crypto_free_tfm(tfm); | 235 | crypto_free_tfm(tfm); |
241 | return code; | 236 | return 0; |
242 | } | 237 | } |
243 | 238 | ||
244 | EXPORT_SYMBOL(make_checksum); | 239 | EXPORT_SYMBOL(make_checksum); |