From: Ming Lei Date: Fri, 22 Jun 2012 10:01:40 +0000 (+0800) Subject: driver core: fix shutdown races with probe/remove(v3) X-Git-Tag: v3.6-rc1~99^2~14^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1c6c030fcec6f860d9bb6c632a3ebe62e28440b;p=pandora-kernel.git driver core: fix shutdown races with probe/remove(v3) Firstly, .shutdown callback may touch a uninitialized hardware if dev->driver is set and .probe is not completed. Secondly, device_shutdown() may dereference a null pointer to cause oops when dev->driver is cleared after it has been checked in device_shutdown(). So just hold device lock and its parent lock(if it has) to fix the races. Cc: Alan Stern Signed-off-by: Ming Lei Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed