Bug 40302

Summary: [PATCH]spi master's parent device node 's reference count is not decreased
Product: Drivers Reporter: Xu Chao (chao.xu)
Component: OtherAssignee: Grant Likely (grant.likely)
Status: NEW ---    
Severity: normal CC: akpm, alan, chao.xu
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.39, 3.0 Subsystem:
Regression: No Bisected commit-id:
Attachments: the patch for the two bugs.

Description Xu Chao 2011-07-29 01:22:58 UTC
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
Comment 1 Andrew Morton 2011-08-26 23:20:17 UTC
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.
Comment 2 Jean Delvare 2012-08-30 10:14:40 UTC
SPI isn't I2C, and I don't maintain SPI.