Skip to content

Commit

Permalink
[SCSI] iscsi: fix crypto_alloc_hash() error check
Browse files Browse the repository at this point in the history
The return value of crypto_alloc_hash() should be checked by
IS_ERR().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Akinobu Mita authored and James Bottomley committed Jan 6, 2007
1 parent c959e1c commit 59c17ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/iscsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1777,13 +1777,13 @@ iscsi_tcp_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx)
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;
Expand Down

0 comments on commit 59c17ec

Please sign in to comment.