浏览代码

[PATCH] i2c: kzalloc cleanups, 2 of 2

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>
Jean Delvare 19 年之前
父节点
当前提交
deb875c7ff
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/i2c/busses/i2c-amd756-s4882.c

+ 2 - 2
drivers/i2c/busses/i2c-amd756-s4882.c

@@ -169,12 +169,12 @@ static int __init amd756_s4882_init(void)
 	init_MUTEX(&amd756_lock);
 	init_MUTEX(&amd756_lock);
 
 
 	/* Define the 5 virtual adapters and algorithms structures */
 	/* 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))) {
 				      GFP_KERNEL))) {
 		error = -ENOMEM;
 		error = -ENOMEM;
 		goto ERROR1;
 		goto ERROR1;
 	}
 	}
-	if (!(s4882_algo = kmalloc(5 * sizeof(struct i2c_algorithm),
+	if (!(s4882_algo = kzalloc(5 * sizeof(struct i2c_algorithm),
 				   GFP_KERNEL))) {
 				   GFP_KERNEL))) {
 		error = -ENOMEM;
 		error = -ENOMEM;
 		goto ERROR2;
 		goto ERROR2;