]> 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>
Thu, 7 Feb 2013 01:26:22 +0000 (12:26 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:46:23 +0000 (16:46 +1100)
commit0c4245e52baeb888bc8e0f6b5622ecc054492a40
treee5cbeb8c77ed1af5e1ca1b42eff7e54d0aa5d701
parent596cc0035214b5fe8c2ab8ada3f2624f0c8f5ac8
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