Skip to content

Commit

Permalink
[PATCH] rtc: fix idr locking
Browse files Browse the repository at this point in the history
We need to serialize access to the global rtc_idr even in this error path.

Signed-off-by: Sonny Rao <sonny@burdell.org>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Sonny Rao authored and Linus Torvalds committed Jun 28, 2006
1 parent b65b5b5 commit 6ac12df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/rtc/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
kfree(rtc);

exit_idr:
mutex_lock(&idr_lock);
idr_remove(&rtc_idr, id);
mutex_unlock(&idr_lock);

exit:
dev_err(dev, "rtc core: unable to register %s, err = %d\n",
Expand Down

0 comments on commit 6ac12df

Please sign in to comment.