Skip to contentSkip to conversation

telephony: phonedev panics if unregistering device not registered [Bug 9266]

PATCH New Matti Linnanvuori 1 participant 1 message Oct 31, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 telephony: phonedev panics if unregistering device not registered [Bug 9266]

From: Matti Linnanvuori <[email protected]>

Remove panic from phonedev.

---

drivers/telephony/phonedev.c +2 -3
@@ -120,9 +120,8 @@ int phone_register_device(struct phone_d
 void phone_unregister_device(struct phone_device *pfd)
 {
 	mutex_lock(&phone_lock);
-	if (phone_device[pfd->minor] != pfd)
-		panic("phone: bad unregister");
-	phone_device[pfd->minor] = NULL;
+	if (likely(phone_device[pfd->minor] == pfd))
+		phone_device[pfd->minor] = NULL;
 	mutex_unlock(&phone_lock);
 }
 

Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail