Re: [PATCH v2] net/mlx4_core: Fix error handling in mlx4_init_port_info.

From: David Miller
Date: Mon May 14 2018 - 16:29:51 EST


From: Tarick Bedeir <tarick@xxxxxxxxxx>
Date: Sun, 13 May 2018 16:38:45 -0700

> Avoid exiting the function with a lingering sysfs file (if the first
> call to device_create_file() fails while the second succeeds), and avoid
> calling devlink_port_unregister() twice.
>
> In other words, either mlx4_init_port_info() succeeds and returns zero, or
> it fails, returns non-zero, and requires no cleanup.
>
> Fixes: 096335b3f983 ("mlx4_core: Allow dynamic MTU configuration for IB
> ports")
> Signed-off-by: Tarick Bedeir <tarick@xxxxxxxxxx>
> ---
> v1 -> v2: Added "Fixes" tag.

Applied and queued up for -stable.