aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/i2c-dev.c')
-rw-r--r--drivers/i2c/i2c-dev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 89f54a5e848..276ec42a071 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -80,10 +80,9 @@ static struct i2c_dev *get_free_i2c_dev(struct i2c_adapter *adap)
80{ 80{
81 struct i2c_dev *i2c_dev; 81 struct i2c_dev *i2c_dev;
82 82
83 i2c_dev = kmalloc(sizeof(*i2c_dev), GFP_KERNEL); 83 i2c_dev = kzalloc(sizeof(*i2c_dev), GFP_KERNEL);
84 if (!i2c_dev) 84 if (!i2c_dev)
85 return ERR_PTR(-ENOMEM); 85 return ERR_PTR(-ENOMEM);
86 memset(i2c_dev, 0x00, sizeof(*i2c_dev));
87 86
88 spin_lock(&i2c_dev_array_lock); 87 spin_lock(&i2c_dev_array_lock);
89 if (i2c_dev_array[adap->nr]) { 88 if (i2c_dev_array[adap->nr]) {