aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/emulex/benet/be_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be_cmds.c')
-rw-r--r--drivers/net/ethernet/emulex/benet/be_cmds.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index fd7b547698ab..a236ecd27cf3 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -2976,22 +2976,17 @@ static struct be_nic_resource_desc *be_get_nic_desc(u8 *buf, u32 desc_count,
2976 for (i = 0; i < desc_count; i++) { 2976 for (i = 0; i < desc_count; i++) {
2977 desc->desc_len = desc->desc_len ? : RESOURCE_DESC_SIZE; 2977 desc->desc_len = desc->desc_len ? : RESOURCE_DESC_SIZE;
2978 if (((void *)desc + desc->desc_len) > 2978 if (((void *)desc + desc->desc_len) >
2979 (void *)(buf + max_buf_size)) { 2979 (void *)(buf + max_buf_size))
2980 desc = NULL; 2980 return NULL;
2981 break;
2982 }
2983 2981
2984 if (desc->desc_type == NIC_RESOURCE_DESC_TYPE_V0 || 2982 if (desc->desc_type == NIC_RESOURCE_DESC_TYPE_V0 ||
2985 desc->desc_type == NIC_RESOURCE_DESC_TYPE_V1) 2983 desc->desc_type == NIC_RESOURCE_DESC_TYPE_V1)
2986 break; 2984 return desc;
2987 2985
2988 desc = (void *)desc + desc->desc_len; 2986 desc = (void *)desc + desc->desc_len;
2989 } 2987 }
2990 2988
2991 if (!desc || i == MAX_RESOURCE_DESC) 2989 return NULL;
2992 return NULL;
2993
2994 return desc;
2995} 2990}
2996 2991
2997/* Uses Mbox */ 2992/* Uses Mbox */