diff options
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r-- | drivers/net/mlx4/port.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/mlx4/port.c b/drivers/net/mlx4/port.c index 606aa58afde..8674ad5764c 100644 --- a/drivers/net/mlx4/port.c +++ b/drivers/net/mlx4/port.c | |||
@@ -111,6 +111,12 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index) | |||
111 | goto out; | 111 | goto out; |
112 | } | 112 | } |
113 | } | 113 | } |
114 | |||
115 | if (free < 0) { | ||
116 | err = -ENOMEM; | ||
117 | goto out; | ||
118 | } | ||
119 | |||
114 | mlx4_dbg(dev, "Free MAC index is %d\n", free); | 120 | mlx4_dbg(dev, "Free MAC index is %d\n", free); |
115 | 121 | ||
116 | if (table->total == table->max) { | 122 | if (table->total == table->max) { |
@@ -205,6 +211,11 @@ int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index) | |||
205 | } | 211 | } |
206 | } | 212 | } |
207 | 213 | ||
214 | if (free < 0) { | ||
215 | err = -ENOMEM; | ||
216 | goto out; | ||
217 | } | ||
218 | |||
208 | if (table->total == table->max) { | 219 | if (table->total == table->max) { |
209 | /* No free vlan entries */ | 220 | /* No free vlan entries */ |
210 | err = -ENOSPC; | 221 | err = -ENOSPC; |