* [PATCH] sctp: fix crypto_alloc_hash() error check
@ 2006-11-27 4:57 Akinobu Mita
0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2006-11-27 4:57 UTC (permalink / raw)
To: netdev; +Cc: David Miller
The return value of crypto_alloc_hash() should be checked by
IS_ERR().
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
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;
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-11-27 5:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-27 4:57 [PATCH] sctp: fix crypto_alloc_hash() error check Akinobu Mita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).