Created attachment 67072 [details] the patch for the two bugs. There are two bugs in it. (1) when spi master is deconstructed, it's parent device node's reference count is not decreased. It exists from kernel 2.6.28 to 3.0. It sometimes results in memory leak. Example, its's parent device node will be always reference by others and never be released. (2) when spi device is created, its parent device node should be spi master. It should be keep consistent with function spi_unregister_master. it exists in 2.6.39 and 3.0
Please don't send patches via bugzilla - it causes lots of problems with our usual patch management and review processes. Please send this patch via email as per Documentation/SubmittingPatches. Suitable recipients may be found via scripts/get_maintainer.pl. Please also cc myself on the email. Thanks.
SPI isn't I2C, and I don't maintain SPI.