]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mlx4_core: Clean up error flow in mlx4_register_mac()
authorRoland Dreier <roland@purestorage.com>
Thu, 6 Oct 2011 16:33:11 +0000 (09:33 -0700)
committerJoe Jin <joe.jin@oracle.com>
Thu, 15 Dec 2011 01:23:05 +0000 (09:23 +0800)
commit4ea5207b6c51705e0c565e657a80f0ab6d388650
treefa712f5359c9dc26288c21800620d26468ac9ff3
parent772561ac3f61d4034080a7ecb6b8574985b063e5
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>
(cherry picked from commit 0f6740c7c455693f719580f34bb8afa8a298ea36)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/mlx4/port.c