summaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon_class.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/extcon/extcon_class.c')
-rw-r--r--drivers/extcon/extcon_class.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c
index dbd3bfba42da..53c64a98b0be 100644
--- a/drivers/extcon/extcon_class.c
+++ b/drivers/extcon/extcon_class.c
@@ -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;
OpenPOWER on IntegriCloud