]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
hwmon/f71882fg: Set platform drvdata to NULL later
authorHans de Goede <hdegoede@redhat.com>
Sun, 13 Mar 2011 12:50:33 +0000 (13:50 +0100)
committerAK <andi@firstfloor.org>
Thu, 31 Mar 2011 18:58:35 +0000 (11:58 -0700)
commit d9ebaa45472c92704f4814682eec21455edcfa1f upstream.

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>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/hwmon/f71882fg.c

index 537841ef44b99d179318f7510dbf28dddedb0ed8..fec078de1568ed6800e1b77ce8fc22d215310073 100644 (file)
@@ -2100,7 +2100,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);
 
@@ -2167,6 +2166,7 @@ static int f71882fg_remove(struct platform_device *pdev)
                }
        }
 
+       platform_set_drvdata(pdev, NULL);
        kfree(data);
 
        return 0;