[SCSI] iscsi: fix crypto_alloc_hash() error check
authorAkinobu Mita <akinobu.mita@gmail.com>
Sun, 17 Dec 2006 18:10:25 +0000 (12:10 -0600)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Sat, 6 Jan 2007 14:59:52 +0000 (08:59 -0600)
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>
drivers/scsi/iscsi_tcp.c

index 61e3a6124c4b7a52a7d72ac7ac82dc312fdab8e9..8889686314713d6bd16495adfdfd8b4b5be6bcf8 100644 (file)
@@ -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;