The return value of crypto_alloc_hash() should be checked by
IS_ERR().
Cc: David Miller <[EMAIL PROTECTED]>
Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>
---
net/sctp/socket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: work-fault-inject/net/sctp/socket.c
===================================================================
--- work-fault-inject.orig/net/sctp/socket.c
+++ work-fault-inject/net/sctp/socket.c
@@ -4885,8 +4885,8 @@ int sctp_inet_listen(struct socket *sock
/* Allocate HMAC for generating cookie. */
if (sctp_hmac_alg) {
tfm = crypto_alloc_hash(sctp_hmac_alg, 0, CRYPTO_ALG_ASYNC);
- if (!tfm) {
- err = -ENOSYS;
+ if (IS_ERR(tfm)) {
+ err = PTR_ERR(tfm);
goto out;
}
}
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html