diff mbox

[net-next] ixgbe: return error in set_rar when index out of range

Message ID AANLkTinu7M4fMmNXqlpMmMyRBySbY5lMGnRATI36xshZ@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kirsher, Jeffrey T May 19, 2010, 12:19 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index 1159d91..9595b1b 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -1188,6 +1188,7 @@  s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw,
u32 index, u8 *addr, u32 vmdq,
 		IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
 	} else {
 		hw_dbg(hw, "RAR index %d is out of range.\n", index);
+		return IXGBE_ERR_RAR_INDEX;
 	}

 	return 0;
@@ -1219,6 +1220,7 @@  s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw,
u32 index)
 		IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
 	} else {
 		hw_dbg(hw, "RAR index %d is out of range.\n", index);
+		return IXGBE_ERR_RAR_INDEX;
 	}

 	/* clear VMDq pool/queue selection for this RAR */
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index bd69196..37d2807 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -2600,6 +2600,7 @@  struct ixgbe_info {
 #define IXGBE_ERR_FDIR_REINIT_FAILED            -23
 #define IXGBE_ERR_EEPROM_VERSION                -24
 #define IXGBE_ERR_NO_SPACE                      -25
+#define IXGBE_ERR_RAR_INDEX                     -26
 #define IXGBE_NOT_IMPLEMENTED                   0x7FFFFFFF

 #endif /* _IXGBE_TYPE_H_ */