linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / i2c / busses / i2c-amd756-s4882.c
index 4e553e8..56c7d98 100644 (file)
@@ -169,12 +169,12 @@ static int __init amd756_s4882_init(void)
        init_MUTEX(&amd756_lock);
 
        /* Define the 5 virtual adapters and algorithms structures */
-       if (!(s4882_adapter = kmalloc(5 * sizeof(struct i2c_adapter),
+       if (!(s4882_adapter = kzalloc(5 * sizeof(struct i2c_adapter),
                                      GFP_KERNEL))) {
                error = -ENOMEM;
                goto ERROR1;
        }
-       if (!(s4882_algo = kmalloc(5 * sizeof(struct i2c_algorithm),
+       if (!(s4882_algo = kzalloc(5 * sizeof(struct i2c_algorithm),
                                   GFP_KERNEL))) {
                error = -ENOMEM;
                goto ERROR2;
@@ -245,10 +245,8 @@ static void __exit amd756_s4882_exit(void)
                kfree(s4882_adapter);
                s4882_adapter = NULL;
        }
-       if (s4882_algo) {
-               kfree(s4882_algo);
-               s4882_algo = NULL;
-       }
+       kfree(s4882_algo);
+       s4882_algo = NULL;
 
        /* Restore physical bus */
        if (i2c_add_adapter(&amd756_smbus))