diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index 4278764d82b82731483c15023d81ce7b6fab4b9b..1d898ee4018c928aae1a0a19e42b6b97785826aa 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -494,6 +494,7 @@ int sctp_auth_init_hmacs(struct sctp_endpoint *ep, gfp_t gfp)
 out_err:
 	/* Clean up any successful allocations */
 	sctp_auth_destroy_hmacs(ep->auth_hmacs);
+	ep->auth_hmacs = NULL;
 	return -ENOMEM;
 }