Extcon: check for allocation failure
[deliverable/linux.git] / drivers / extcon / extcon_class.c
index dbd3bfba42daa8019f9416fc68c04b1359dc51c1..53c64a98b0bedb9308cebaa92d46b9b570e045b7 100644 (file)
@@ -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;
This page took 0.02637 seconds and 5 git commands to generate.