From: Rebecca Schultz Zavin Date: Fri, 13 Dec 2013 22:24:01 +0000 (-0800) Subject: gpu: ion: Fix race between ion_import and ion_free X-Git-Tag: v3.14-rc1~150^2~450 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e9c03a58ed599594780a69c988bd11e6459a752;p=pandora-kernel.git gpu: ion: Fix race between ion_import and ion_free If preemted during ion_free after the refcount is updated but before the handle can be removed from the rb_tree, import might find that handle in the tree and try to reuse it when execution returns to free, the handle will be cleaned up leaving the caller of import with a corrupt handle. This patch modifies the locking to protect agains this race. Signed-off-by: Rebecca Schultz Zavin [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed