From: Ming Lei Date: Sat, 4 Aug 2012 04:01:23 +0000 (+0800) Subject: firmware loader: fix device lifetime X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~76^2~80 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cfc1e1e7b5347b4b6df1212f365ce6620bdd98f;p=pandora-kernel.git firmware loader: fix device lifetime Callers of request_firmware* must hold the reference count of @device, otherwise it is easy to trigger oops since the firmware loader device is the child of @device. This patch adds comments about the usage. In fact, most of drivers call request_firmware* in its probe() or open(), so the constraint should be reasonable and can be satisfied. Also this patch holds the reference count of @device before schedule_work() in request_firmware_nowait() to avoid that the @device is released after request_firmware_nowait returns and before the worker function is scheduled. Signed-off-by: Ming Lei Cc: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed