mempolicy: ERR_PTR dereference in mpol_shared_policy_init()
[safe/jmp/linux-2.6] / drivers / rtc / rtc-pcf8563.c
index b725913..1af42b4 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/i2c.h>
 #include <linux/bcd.h>
 #include <linux/rtc.h>
+#include <linux/slab.h>
 
 #define DRV_VERSION "0.4.3"
 
@@ -212,6 +213,8 @@ static int pcf8563_probe(struct i2c_client *client,
 
        dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n");
 
+       i2c_set_clientdata(client, pcf8563);
+
        pcf8563->rtc = rtc_device_register(pcf8563_driver.driver.name,
                                &client->dev, &pcf8563_rtc_ops, THIS_MODULE);
 
@@ -220,8 +223,6 @@ static int pcf8563_probe(struct i2c_client *client,
                goto exit_kfree;
        }
 
-       i2c_set_clientdata(client, pcf8563);
-
        return 0;
 
 exit_kfree: