[ALSA] unregister platform device again if probe was unsuccessful
[linux-3.10.git] / sound / drivers / dummy.c
index ae0df549fac7763843412746622681a1bad1d440..ffeafaf2eccae64956ac2bfd8034257fbb10b92c 100644 (file)
@@ -677,6 +677,10 @@ static int __init alsa_card_dummy_init(void)
                                                         i, NULL, 0);
                if (IS_ERR(device))
                        continue;
+               if (!platform_get_drvdata(device)) {
+                       platform_device_unregister(device);
+                       continue;
+               }
                devices[i] = device;
                cards++;
        }