On Tue, 2014-09-02 at 17:49 -0400, Joern Engel wrote: > Old code was obviously buggy and effectively ignored the high byte. > Found by coverity. > > Signed-off-by: Joern Engel <joern@xxxxxxxxx> > --- > drivers/target/target_core_fabric_lib.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c > index 0d1cf8b4f49f..35bfe77160d8 100644 > --- a/drivers/target/target_core_fabric_lib.c > +++ b/drivers/target/target_core_fabric_lib.c > @@ -394,9 +394,9 @@ char *iscsi_parse_pr_out_transport_id( > * If the caller wants the TransportID Length, we set that value for the > * entire iSCSI Tarnsport ID now. > */ > - if (out_tid_len != NULL) { > - add_len = ((buf[2] >> 8) & 0xff); > - add_len |= (buf[3] & 0xff); > + if (out_tid_len) { > + /* The shift works thanks to integer promotion rules */ > + add_len = (buf[2] << 8) | buf[3]; > > tid_len = strlen(&buf[4]); > tid_len += 4; /* Add four bytes for iSCSI Transport ID header */ Applied to target-pending/for-next. -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html