hwmon/f71882fg: Set platform drvdata to NULL later

This avoids a possible race leading to trying to dereference NULL.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
This commit is contained in:
Hans de Goede 2011-03-13 13:50:33 +01:00 committed by Guenter Roeck
parent 14a4019de8
commit d9ebaa4547

View File

@ -2111,7 +2111,6 @@ static int f71882fg_remove(struct platform_device *pdev)
int nr_fans = (data->type == f71882fg) ? 4 : 3;
u8 start_reg = f71882fg_read8(data, F71882FG_REG_START);
platform_set_drvdata(pdev, NULL);
if (data->hwmon_dev)
hwmon_device_unregister(data->hwmon_dev);
@ -2178,6 +2177,7 @@ static int f71882fg_remove(struct platform_device *pdev)
}
}
platform_set_drvdata(pdev, NULL);
kfree(data);
return 0;