]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mlx4_core: Clean up error flow in mlx4_register_mac()
authorRoland Dreier <roland@purestorage.com>
Tue, 20 Sep 2011 07:48:42 +0000 (00:48 -0700)
committerRoland Dreier <roland@purestorage.com>
Tue, 20 Sep 2011 07:48:42 +0000 (00:48 -0700)
commit7d13f1bb7f26442a97609b1d42f440396617ca81
tree50d64f971c3ddb3c7281b90a1dc673bc7a6cb16b
parentfcb8ce5cfe30ca9ca5c9a79cdfe26d1993e65e0c
mlx4_core: Clean up error flow in mlx4_register_mac()

Fix a leak of entry if radix_tree_insert() fails.

Also, reduce the indentation and make the flow easier to read by
sticking to the conventional

    err = do_something();
    if (err)
            return err;

    err = do_another();
    if (err)
            return err;

rather than mixing the direction of the test as

    err = do_something();
    if (!err) {
            err = do_another();
            if (err)
                    return err;
    } else
            return err;

Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/net/mlx4/port.c