All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 23/30] iscsi: fix crypto_alloc_hash() error check
@ 2006-12-04 23:18 akpm
  2006-12-05  0:20 ` Mike Christie
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2006-12-04 23:18 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, akinobu.mita, dmitry_yus, itn780

From: Akinobu Mita <akinobu.mita@gmail.com>

The return value of crypto_alloc_hash() should be checked by
IS_ERR().

Cc: Dmitry Yusupov <dmitry_yus@yahoo.com>
Cc: Alex Aizman <itn780@yahoo.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/scsi/iscsi_tcp.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/scsi/iscsi_tcp.c~iscsi-fix-crypto_alloc_hash-error-check drivers/scsi/iscsi_tcp.c
--- a/drivers/scsi/iscsi_tcp.c~iscsi-fix-crypto_alloc_hash-error-check
+++ a/drivers/scsi/iscsi_tcp.c
@@ -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;
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 23/30] iscsi: fix crypto_alloc_hash() error check
  2006-12-04 23:18 [patch 23/30] iscsi: fix crypto_alloc_hash() error check akpm
@ 2006-12-05  0:20 ` Mike Christie
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Christie @ 2006-12-05  0:20 UTC (permalink / raw)
  To: akpm; +Cc: James.Bottomley, linux-scsi, akinobu.mita, dmitry_yus, itn780

akpm@osdl.org wrote:
> From: Akinobu Mita <akinobu.mita@gmail.com>
> 
> The return value of crypto_alloc_hash() should be checked by
> IS_ERR().

Looks good to me.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>

Either James can merge it or Andrew can forward it or if when I send my
update it is not merged by someone I will resend it.


> 
> Cc: Dmitry Yusupov <dmitry_yus@yahoo.com>
> Cc: Alex Aizman <itn780@yahoo.com>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: James Bottomley <James.Bottomley@steeleye.com>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
> 
>  drivers/scsi/iscsi_tcp.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -puN drivers/scsi/iscsi_tcp.c~iscsi-fix-crypto_alloc_hash-error-check drivers/scsi/iscsi_tcp.c
> --- a/drivers/scsi/iscsi_tcp.c~iscsi-fix-crypto_alloc_hash-error-check
> +++ a/drivers/scsi/iscsi_tcp.c
> @@ -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;
> _
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-05  0:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-04 23:18 [patch 23/30] iscsi: fix crypto_alloc_hash() error check akpm
2006-12-05  0:20 ` Mike Christie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.