mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
platform/x86: mlx-platform: free first dev on error
commit63d762b88cupstream. There is an off-by-one error so we don't unregister priv->pdev_mux[0]. Also it's slightly simpler as a while loop instead of a for loop. Fixes:58cbbee239("x86/platform/mellanox: Introduce support for Mellanox systems platform") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Vadim Pasternak <vadimp@mellanox.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
776050a9b5
commit
adb260d151
@@ -233,7 +233,7 @@ static int __init mlxplat_init(void)
|
||||
return 0;
|
||||
|
||||
fail_platform_mux_register:
|
||||
for (i--; i > 0 ; i--)
|
||||
while (--i >= 0)
|
||||
platform_device_unregister(priv->pdev_mux[i]);
|
||||
platform_device_unregister(priv->pdev_i2c);
|
||||
fail_alloc:
|
||||
|
||||
Reference in New Issue
Block a user