Commit d9ebaa45 authored by Hans de Goede's avatar Hans de Goede Committed by Guenter Roeck

hwmon/f71882fg: Set platform drvdata to NULL later

This avoids a possible race leading to trying to dereference NULL.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
parent 14a4019d
...@@ -2111,7 +2111,6 @@ static int f71882fg_remove(struct platform_device *pdev) ...@@ -2111,7 +2111,6 @@ static int f71882fg_remove(struct platform_device *pdev)
int nr_fans = (data->type == f71882fg) ? 4 : 3; int nr_fans = (data->type == f71882fg) ? 4 : 3;
u8 start_reg = f71882fg_read8(data, F71882FG_REG_START); u8 start_reg = f71882fg_read8(data, F71882FG_REG_START);
platform_set_drvdata(pdev, NULL);
if (data->hwmon_dev) if (data->hwmon_dev)
hwmon_device_unregister(data->hwmon_dev); hwmon_device_unregister(data->hwmon_dev);
...@@ -2178,6 +2177,7 @@ static int f71882fg_remove(struct platform_device *pdev) ...@@ -2178,6 +2177,7 @@ static int f71882fg_remove(struct platform_device *pdev)
} }
} }
platform_set_drvdata(pdev, NULL);
kfree(data); kfree(data);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment