]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Bug fix: Hold spinlock across find|remove /sys/firmware/memmap/X operation.
authorTang Chen <tangchen@cn.fujitsu.com>
Wed, 20 Feb 2013 02:14:11 +0000 (13:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:52:27 +0000 (16:52 +1100)
commitadedcc3b35e9cb1cfe60a0932d1e2aee58c1d941
treee0f85db8787cdd2c998e85a7f08860f4461b0130
parent64d008147ae4f2e6654a78278108c34e5108821d
Bug fix: Hold spinlock across find|remove /sys/firmware/memmap/X operation.

It is unsafe to return an entry pointer and release the map_entries_lock.
So we should not hold the map_entries_lock separately in
firmware_map_find_entry() and firmware_map_remove_entry().  Hold the
map_entries_lock across find and remove /sys/firmware/memmap/X operation.

And also, users of these two functions need to be careful to hold the lock
when using these two functions.

The suggestion is from Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Tang Chen <tangchen@cn.fujitsu.com>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/firmware/memmap.c