mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[NET]: kfree cleanup
From: Jesper Juhl <[email protected]> This is the net/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in net/. Signed-off-by: Jesper Juhl <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
parent
ac7c98eca8
commit
a51482bde2
47 changed files with 99 additions and 191 deletions
|
|
@ -143,6 +143,6 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
|
|||
|
||||
return ((ctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE);
|
||||
out_err:
|
||||
if (md5cksum.data) kfree(md5cksum.data);
|
||||
kfree(md5cksum.data);
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,6 +176,6 @@ gss_verify_mic_kerberos(struct gss_ctx *gss_ctx,
|
|||
|
||||
ret = GSS_S_COMPLETE;
|
||||
out:
|
||||
if (md5cksum.data) kfree(md5cksum.data);
|
||||
kfree(md5cksum.data);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,8 +60,7 @@ gss_mech_free(struct gss_api_mech *gm)
|
|||
|
||||
for (i = 0; i < gm->gm_pf_num; i++) {
|
||||
pf = &gm->gm_pfs[i];
|
||||
if (pf->auth_domain_name)
|
||||
kfree(pf->auth_domain_name);
|
||||
kfree(pf->auth_domain_name);
|
||||
pf->auth_domain_name = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,8 +122,7 @@ spkm3_make_token(struct spkm3_ctx *ctx,
|
|||
|
||||
return GSS_S_COMPLETE;
|
||||
out_err:
|
||||
if (md5cksum.data)
|
||||
kfree(md5cksum.data);
|
||||
kfree(md5cksum.data);
|
||||
token->data = NULL;
|
||||
token->len = 0;
|
||||
return GSS_S_FAILURE;
|
||||
|
|
|
|||
|
|
@ -259,8 +259,7 @@ spkm3_verify_mic_token(unsigned char **tokp, int *mic_hdrlen, unsigned char **ck
|
|||
|
||||
ret = GSS_S_COMPLETE;
|
||||
out:
|
||||
if (spkm3_ctx_id.data)
|
||||
kfree(spkm3_ctx_id.data);
|
||||
kfree(spkm3_ctx_id.data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,9 +120,7 @@ spkm3_read_token(struct spkm3_ctx *ctx,
|
|||
/* XXX: need to add expiration and sequencing */
|
||||
ret = GSS_S_COMPLETE;
|
||||
out:
|
||||
if (md5cksum.data)
|
||||
kfree(md5cksum.data);
|
||||
if (wire_cksum.data)
|
||||
kfree(wire_cksum.data);
|
||||
kfree(md5cksum.data);
|
||||
kfree(wire_cksum.data);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,12 +196,9 @@ svc_exit_thread(struct svc_rqst *rqstp)
|
|||
struct svc_serv *serv = rqstp->rq_server;
|
||||
|
||||
svc_release_buffer(rqstp);
|
||||
if (rqstp->rq_resp)
|
||||
kfree(rqstp->rq_resp);
|
||||
if (rqstp->rq_argp)
|
||||
kfree(rqstp->rq_argp);
|
||||
if (rqstp->rq_auth_data)
|
||||
kfree(rqstp->rq_auth_data);
|
||||
kfree(rqstp->rq_resp);
|
||||
kfree(rqstp->rq_argp);
|
||||
kfree(rqstp->rq_auth_data);
|
||||
kfree(rqstp);
|
||||
|
||||
/* Release the server */
|
||||
|
|
|
|||
|
|
@ -992,8 +992,7 @@ xdr_xcode_array2(struct xdr_buf *buf, unsigned int base,
|
|||
err = 0;
|
||||
|
||||
out:
|
||||
if (elem)
|
||||
kfree(elem);
|
||||
kfree(elem);
|
||||
if (ppages)
|
||||
kunmap(*ppages);
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue