* [patch] iscsi: change & to &&
@ 2010-03-08 12:21 Dan Carpenter
2010-03-08 20:57 ` Mike Christie
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-03-08 12:21 UTC (permalink / raw)
To: Mike Christie
Cc: James E.J. Bottomley, Andrew Morton, Stefani Seibold, Andi Kleen,
open-iscsi, linux-scsi, kernel-janitors
This change is basically a clean up.
datadgst_en is an int which comes from the user. I didn't see anything
limiting it to 1 and 0 although obviously that's what it's supposed to
be. If the user passed in 2 this test would fail.
This same if condition is repeated in another function and it uses &&
there.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c
index 4ad87fd..3794d29 100644
--- a/drivers/scsi/libiscsi_tcp.c
+++ b/drivers/scsi/libiscsi_tcp.c
@@ -420,7 +420,7 @@ iscsi_tcp_data_recv_prep(struct iscsi_tcp_conn *tcp_conn)
struct iscsi_conn *conn = tcp_conn->iscsi_conn;
struct hash_desc *rx_hash = NULL;
- if (conn->datadgst_en &
+ if (conn->datadgst_en &&
!(conn->session->tt->caps & CAP_DIGEST_OFFLOAD))
rx_hash = tcp_conn->rx_hash;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] iscsi: change & to &&
2010-03-08 12:21 [patch] iscsi: change & to && Dan Carpenter
@ 2010-03-08 20:57 ` Mike Christie
0 siblings, 0 replies; 2+ messages in thread
From: Mike Christie @ 2010-03-08 20:57 UTC (permalink / raw)
To: Dan Carpenter
Cc: James E.J. Bottomley, Andrew Morton, Stefani Seibold, Andi Kleen,
open-iscsi-/JYPxA39Uh5TLH3MbocFFw,
linux-scsi-u79uwXL29TY76Z2rM5mHXA,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA
On 03/08/2010 06:21 AM, Dan Carpenter wrote:
> This change is basically a clean up.
>
> datadgst_en is an int which comes from the user. I didn't see anything
> limiting it to 1 and 0 although obviously that's what it's supposed to
> be. If the user passed in 2 this test would fail.
>
> This same if condition is repeated in another function and it uses&&
> there.
>
> Signed-off-by: Dan Carpenter<error27-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c
> index 4ad87fd..3794d29 100644
> --- a/drivers/scsi/libiscsi_tcp.c
> +++ b/drivers/scsi/libiscsi_tcp.c
> @@ -420,7 +420,7 @@ iscsi_tcp_data_recv_prep(struct iscsi_tcp_conn *tcp_conn)
> struct iscsi_conn *conn = tcp_conn->iscsi_conn;
> struct hash_desc *rx_hash = NULL;
>
> - if (conn->datadgst_en&
> + if (conn->datadgst_en&&
> !(conn->session->tt->caps& CAP_DIGEST_OFFLOAD))
> rx_hash = tcp_conn->rx_hash;
>
Doh. Thanks!
Reviewed-by: Mike Christie <michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
--
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To post to this group, send email to open-iscsi-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to open-iscsi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at http://groups.google.com/group/open-iscsi?hl=en.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-08 20:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-08 12:21 [patch] iscsi: change & to && Dan Carpenter
2010-03-08 20:57 ` Mike Christie
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).