[PATCH] i2c: kzalloc cleanups, 2 of 2
authorJean Delvare <khali@linux-fr.org>
Mon, 17 Oct 2005 21:14:31 +0000 (23:14 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 28 Oct 2005 21:02:12 +0000 (14:02 -0700)
Use kzalloc instead of kmalloc in the S4882 SMBus multiplexing driver.
I guess it's safer that way.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/i2c/busses/i2c-amd756-s4882.c

index 4e553e8c5cbada81053978ba6b1f12bdf2b1404a..f51ab652300a66a5d629ac3937622e289f379bf7 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;