aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/libfcoe.c
diff options
context:
space:
mode:
authorBhanu Prakash Gollapudi <bprakash@broadcom.com>2010-06-11 19:43:38 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:01:43 -0400
commit1508f3ecd991ecbf272e08f5ee70d2618f49159e (patch)
treeff48da276987be68be2e2658728d7fca14fb15bf /drivers/scsi/fcoe/libfcoe.c
parent281ae642a6475ede25ff86ec124214e346c25e22 (diff)
[SCSI] libfcoe: Avoid hang when receiving non-critical descriptors
Avoid infinite loop while processing FIP ELS or discovery advertisement with non-critical descriptors. Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Acked-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe/libfcoe.c')
-rw-r--r--drivers/scsi/fcoe/libfcoe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index cc5e8864b805..66120f135d99 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -703,7 +703,7 @@ static int fcoe_ctlr_parse_adv(struct fcoe_ctlr *fip,
703 /* standard says ignore unknown descriptors >= 128 */ 703 /* standard says ignore unknown descriptors >= 128 */
704 if (desc->fip_dtype < FIP_DT_VENDOR_BASE) 704 if (desc->fip_dtype < FIP_DT_VENDOR_BASE)
705 return -EINVAL; 705 return -EINVAL;
706 continue; 706 break;
707 } 707 }
708 desc = (struct fip_desc *)((char *)desc + dlen); 708 desc = (struct fip_desc *)((char *)desc + dlen);
709 rlen -= dlen; 709 rlen -= dlen;
@@ -885,7 +885,7 @@ static void fcoe_ctlr_recv_els(struct fcoe_ctlr *fip, struct sk_buff *skb)
885 /* standard says ignore unknown descriptors >= 128 */ 885 /* standard says ignore unknown descriptors >= 128 */
886 if (desc->fip_dtype < FIP_DT_VENDOR_BASE) 886 if (desc->fip_dtype < FIP_DT_VENDOR_BASE)
887 goto drop; 887 goto drop;
888 continue; 888 break;
889 } 889 }
890 desc = (struct fip_desc *)((char *)desc + dlen); 890 desc = (struct fip_desc *)((char *)desc + dlen);
891 rlen -= dlen; 891 rlen -= dlen;