Skip to content

Commit

Permalink
telephony: phonedev panics if unregistering device not registered [Bu…
Browse files Browse the repository at this point in the history
…g 9266]

Remove panic from phonedev.  See

	http://bugzilla.kernel.org/show_bug.cgi?id=9266

for details (phonedev panics if unregistering device not registered).

Signed-off-by: Matti Linnanvuori <mattilinnanvuori@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Matti Linnanvuori authored and Linus Torvalds committed Nov 5, 2007
1 parent def6ae2 commit 01aae97
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/telephony/phonedev.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ int phone_register_device(struct phone_device *p, int unit)
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);
}

Expand Down

0 comments on commit 01aae97

Please sign in to comment.