[01/44] hwmon/f71882fg: Set platform drvdata to NULL later

From: Greg KH
Date: Mon Mar 21 2011 - 19:13:34 EST

2.6.32-longterm review patch. If anyone has any objections, please let us know.


From: Hans de Goede <hdegoede@xxxxxxxxxx>

commit d9ebaa45472c92704f4814682eec21455edcfa1f upstream.

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

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
Acked-by: Jean Delvare <khali@xxxxxxxxxxxx>
Signed-off-by: Guenter Roeck <guenter.roeck@xxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

drivers/hwmon/f71882fg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/hwmon/f71882fg.c
+++ b/drivers/hwmon/f71882fg.c
@@ -1957,7 +1957,6 @@ static int f71882fg_remove(struct platfo
int i;
struct f71882fg_data *data = platform_get_drvdata(pdev);

- platform_set_drvdata(pdev, NULL);
if (data->hwmon_dev)

@@ -1982,6 +1981,7 @@ static int f71882fg_remove(struct platfo
for (i = 0; i < ARRAY_SIZE(f8000_fan_attr); i++)
device_remove_file(&pdev->dev, &f8000_fan_attr[i].dev_attr);

+ platform_set_drvdata(pdev, NULL);

return 0;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/