Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8dc4984a6bdcaf56cdb458a7338c32c16f32540c
Commit:     8dc4984a6bdcaf56cdb458a7338c32c16f32540c
Parent:     d9568ba91b1fdd1ea4fdbf9fcc76b867cca6c1d5
Author:     Vlad Yasevich <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 13:50:20 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu May 10 23:45:29 2007 -0700

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 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 83a76ba..f3c95f9 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5227,7 +5227,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;
                }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to