diff options
Diffstat (limited to 'drivers/telephony/phonedev.c')
-rw-r--r-- | drivers/telephony/phonedev.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c index 4d8c2a5b329..bcea8d9b718 100644 --- a/drivers/telephony/phonedev.c +++ b/drivers/telephony/phonedev.c | |||
@@ -120,9 +120,8 @@ int phone_register_device(struct phone_device *p, int unit) | |||
120 | void phone_unregister_device(struct phone_device *pfd) | 120 | void phone_unregister_device(struct phone_device *pfd) |
121 | { | 121 | { |
122 | mutex_lock(&phone_lock); | 122 | mutex_lock(&phone_lock); |
123 | if (phone_device[pfd->minor] != pfd) | 123 | if (likely(phone_device[pfd->minor] == pfd)) |
124 | panic("phone: bad unregister"); | 124 | phone_device[pfd->minor] = NULL; |
125 | phone_device[pfd->minor] = NULL; | ||
126 | mutex_unlock(&phone_lock); | 125 | mutex_unlock(&phone_lock); |
127 | } | 126 | } |
128 | 127 | ||