iscsi: fix crypto_alloc_hash() error check
PATCH 21/26 iscsi: fix crypto_alloc_hash() error check
From: Akinobu Mita <[email protected]>
The return value of crypto_alloc_hash() should be checked by IS_ERR().
Cc Dmitry Yusupov <[email protected]>
Cc Alex Aizman <[email protected]>
Signed-off-by Akinobu Mita <[email protected]>
Cc James Bottomley <[email protected]>
Acked-by Mike Christie <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/scsi/iscsi_tcp.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/iscsi_tcp.c renamed from drivers/scsi/iscsi_tcp.c~iscsi-fix-crypto_alloc_hash-error-check +2 -2
@@ -1777,13 +1777,13 @@ iscsi_tcp_conn_create(struct iscsi_cls_s tcp_conn->tx_hash.tfm =crypto_alloc_hash ("crc32c" ,0 ,CRYPTO_ALG_ASYNC ); tcp_conn->tx_hash.flags =0 ; -if (!tcp_conn->tx_hash.tfm) +if (IS_ERR (tcp_conn->tx_hash.tfm)) goto free_tcp_conn; tcp_conn->rx_hash.tfm =crypto_alloc_hash ("crc32c" ,0 ,CRYPTO_ALG_ASYNC ); tcp_conn->rx_hash.flags =0 ; -if (!tcp_conn->rx_hash.tfm) +if (IS_ERR (tcp_conn->rx_hash.tfm)) goto free_tx_tfm;return cls_conn;
_