net/mlx4_en: Cleanups suggested by clang static checker
[cascardo/linux.git] / drivers / net / ethernet / mellanox / mlx4 / en_main.c
index 2091ae8..9f16f75 100644 (file)
@@ -221,15 +221,12 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
 {
        struct mlx4_en_dev *mdev;
        int i;
-       int err;
 
        printk_once(KERN_INFO "%s", mlx4_en_version);
 
        mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
-       if (!mdev) {
-               err = -ENOMEM;
+       if (!mdev)
                goto err_free_res;
-       }
 
        if (mlx4_pd_alloc(dev, &mdev->priv_pdn))
                goto err_free_dev;
@@ -264,8 +261,7 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
        }
 
        /* Build device profile according to supplied module parameters */
-       err = mlx4_en_get_profile(mdev);
-       if (err) {
+       if (mlx4_en_get_profile(mdev)) {
                mlx4_err(mdev, "Bad module parameters, aborting\n");
                goto err_mr;
        }
@@ -286,10 +282,8 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
         * Note: we cannot use the shared workqueue because of deadlocks caused
         *       by the rtnl lock */
        mdev->workqueue = create_singlethread_workqueue("mlx4_en");
-       if (!mdev->workqueue) {
-               err = -ENOMEM;
+       if (!mdev->workqueue)
                goto err_mr;
-       }
 
        /* At this stage all non-port specific tasks are complete:
         * mark the card state as up */