summaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-04-23 14:54:11 -0400
committerChanwoo Choi <cw00.choi@samsung.com>2017-05-23 05:32:02 -0400
commit3f5071a8b07b697993a16bbe9cbc8c876ba60048 (patch)
treeacf40b2a6eab25fd995b68754bdb66b14a415b39 /drivers/extcon/extcon.c
parent08332893e37af6ae779367e78e444f8f9571511d (diff)
extcon: Use devm_kcalloc() in extcon_dev_register()
A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc". Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon.c')
-rw-r--r--drivers/extcon/extcon.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index f422a78ba342..acb847bc1619 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -1252,9 +1252,8 @@ int extcon_dev_register(struct extcon_dev *edev)
1252 } 1252 }
1253 1253
1254 spin_lock_init(&edev->lock); 1254 spin_lock_init(&edev->lock);
1255 1255 edev->nh = devm_kcalloc(&edev->dev, edev->max_supported,
1256 edev->nh = devm_kzalloc(&edev->dev, 1256 sizeof(*edev->nh), GFP_KERNEL);
1257 sizeof(*edev->nh) * edev->max_supported, GFP_KERNEL);
1258 if (!edev->nh) { 1257 if (!edev->nh) {
1259 ret = -ENOMEM; 1258 ret = -ENOMEM;
1260 goto err_dev; 1259 goto err_dev;