diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2007-05-15 01:32:35 -0700 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2007-05-23 14:32:51 -0700 |
commit | ca526a57325f6ea331115069c44a58c4a85bfa9d (patch) | |
tree | 18157b2fe33048b4bb882bffe70cf5fc81c7ea11 | |
parent | 7b890c17f74b976f82e38b84d29724212fccb91a (diff) |
[PATCH] SCTP: Prevent OOPS if hmac modules didn't load
SCTP was checking for NULL when trying to detect hmac
allocation failure where it should have been using IS_ERR.
Also, print a rate limited warning to the log telling the
user what happend.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
-rw-r--r-- | net/sctp/socket.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index ffaac2043f01..843c928b50c3 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -4989,7 +4989,12 @@ int sctp_inet_listen(struct socket *sock, int backlog) /* Allocate HMAC for generating cookie. */ if (sctp_hmac_alg) { tfm = crypto_alloc_hash(sctp_hmac_alg, 0, CRYPTO_ALG_ASYNC); - if (!tfm) { + if (IS_ERR(tfm)) { + if (net_ratelimit()) { + printk(KERN_INFO + "SCTP: failed to load transform for %s: %ld\n", + sctp_hmac_alg, PTR_ERR(tfm)); + } err = -ENOSYS; goto out; } |