mei: call stop on failed char device register
authorAlexander Usyskin <alexander.usyskin@intel.com>
Sun, 7 Feb 2016 21:35:20 +0000 (23:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2016 22:47:20 +0000 (14:47 -0800)
If registering of character device failed stop the device properly.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/pci-me.c
drivers/misc/mei/pci-txe.c

index 75fc9c688df8fc6fac004c78d8067061eff70749..996344f6c32d9514e71e8663c3a22d2bdf170df8 100644 (file)
@@ -210,7 +210,7 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        err = mei_register(dev, &pdev->dev);
        if (err)
-               goto release_irq;
+               goto stop;
 
        pci_set_drvdata(pdev, dev);
 
@@ -231,6 +231,8 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        return 0;
 
+stop:
+       mei_stop(dev);
 release_irq:
        mei_cancel_work(dev);
        mei_disable_interrupts(dev);
index 71f8a747571756b0941a82f0ee6af99247464744..30cc30683c07186e7ff33d6395f6e8a64d2cf3c0 100644 (file)
@@ -154,7 +154,7 @@ static int mei_txe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        err = mei_register(dev, &pdev->dev);
        if (err)
-               goto release_irq;
+               goto stop;
 
        pci_set_drvdata(pdev, dev);
 
@@ -170,6 +170,8 @@ static int mei_txe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        return 0;
 
+stop:
+       mei_stop(dev);
 release_irq:
 
        mei_cancel_work(dev);