Re: [PATCH 2/3] mn88472: make sure the private data struct is nulled after free

2015-01-19 Thread Benjamin Larsson
On 01/19/2015 02:15 PM, Hans Verkuil wrote: On 12/06/2014 09:26 PM, Benjamin Larsson wrote: Well I guess I am biased as I have spent lots of time finding a bug that probably wouldn't exist if the policy was that drivers always should set their memory to zero before it is free'd. Just because

Re: [PATCH 2/3] mn88472: make sure the private data struct is nulled after free

2015-01-19 Thread Hans Verkuil
On 12/06/2014 09:26 PM, Benjamin Larsson wrote: > On 12/06/2014 07:37 PM, Antti Palosaari wrote: >>> >>> I do think it is good practice to set pointers to null generally as that >>> would have saved me several days of work of whentracking down this bug. >>> The current dvb framework contain several

Re: [PATCH 2/3] mn88472: make sure the private data struct is nulled after free

2014-12-06 Thread Benjamin Larsson
On 12/06/2014 07:37 PM, Antti Palosaari wrote: I do think it is good practice to set pointers to null generally as that would have saved me several days of work of whentracking down this bug. The current dvb framework contain several other cases where pointers are feed'd but not nulled. There

Re: [PATCH 2/3] mn88472: make sure the private data struct is nulled after free

2014-12-06 Thread Antti Palosaari
On 12/06/2014 08:08 PM, Benjamin Larsson wrote: On 12/06/2014 05:29 PM, Antti Palosaari wrote: But that is not needed anymore ? regards Antti Chances are that more devices with the mn8847x chips appear. Someone somewhere might try to use this demod with the old dvb attach model during develop

Re: [PATCH 2/3] mn88472: make sure the private data struct is nulled after free

2014-12-06 Thread Benjamin Larsson
On 12/06/2014 05:29 PM, Antti Palosaari wrote: But that is not needed anymore ? regards Antti Chances are that more devices with the mn8847x chips appear. Someone somewhere might try to use this demod with the old dvb attach model during development. Adding this memset will make the unload i

Re: [PATCH 2/3] mn88472: make sure the private data struct is nulled after free

2014-12-06 Thread Antti Palosaari
But that is not needed anymore ? regards Antti On 12/06/2014 02:25 AM, Benjamin Larsson wrote: Using this driver with the attach dvb model might trigger a use after free when unloading the driver. With this change the driver will always fail on unload instead of randomly crash depending on if t

[PATCH 2/3] mn88472: make sure the private data struct is nulled after free

2014-12-05 Thread Benjamin Larsson
Using this driver with the attach dvb model might trigger a use after free when unloading the driver. With this change the driver will always fail on unload instead of randomly crash depending on if the memory has been reused or not. Signed-off-by: Benjamin Larsson --- drivers/staging/media/mn88