]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/busses/i2c-amd756-s4882.c
[PATCH] kfree cleanup: misc remaining drivers
[linux-2.6-omap-h63xx.git] / drivers / i2c / busses / i2c-amd756-s4882.c
index 4e553e8c5cbada81053978ba6b1f12bdf2b1404a..56c7d987590f51704ea22363796ab34d838c9c1b 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))