]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/mlx4/pd.c
SELinux: Fix a potentially uninitialised variable in SELinux hooks
[linux-2.6-omap-h63xx.git] / drivers / net / mlx4 / pd.c
index 3a93c5f0f7ab8cc0ef33b8559d598b6e0fa82f5c..aa616892d09cbac5c2169e334a5893515ca9fb99 100644 (file)
@@ -91,6 +91,13 @@ EXPORT_SYMBOL_GPL(mlx4_uar_free);
 
 int mlx4_init_uar_table(struct mlx4_dev *dev)
 {
+       if (dev->caps.num_uars <= 128) {
+               mlx4_err(dev, "Only %d UAR pages (need more than 128)\n",
+                        dev->caps.num_uars);
+               mlx4_err(dev, "Increase firmware log2_uar_bar_megabytes?\n");
+               return -ENODEV;
+       }
+
        return mlx4_bitmap_init(&mlx4_priv(dev)->uar_table.bitmap,
                                dev->caps.num_uars, dev->caps.num_uars - 1,
                                max(128, dev->caps.reserved_uars));