Commit a1d26ac0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

Extcon: check for allocation failure

Return -ENOMEM if the kmalloc() fails.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6b960610
......@@ -621,6 +621,8 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
}
edev->dev = kzalloc(sizeof(struct device), GFP_KERNEL);
if (!edev->dev)
return -ENOMEM;
edev->dev->parent = dev;
edev->dev->class = extcon_class;
edev->dev->release = extcon_dev_release;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment