Corey,
You right about me needing to learn to test patches that I make 
better. The issue is that I don't have this hardware so how can
I test on actual hardware if I don't have it. Otherwise I would
have noticed the issues with my patches before sending them in.
Regards,
Nick

On 2015-02-04 03:17 PM, Corey Minyard wrote:
> I've been debating what to do with this, but the patch makes a good
> change, so
> I'll go ahead with it.  I am going to remove the unnecessary braces.
> 
> In the future, you really need to be able to test the changes you make. 
> So you really
> need to work in an area that you can test in.  If you are really
> interested in learning,
> you have a ways to go, I think, and the kernel may not be the best place
> to do that
> learning.
> 
> -corey
> 
> On 01/30/2015 11:17 PM, Nicholas Krause wrote:
>> This adds a loop through the elements in the linked list, recv_msgs using
>> list_for_entry_safe in order to free messages in this list.  In addition
>> we are using the safe version of this marco in order to prevent use after
>> bugs related to deleting the element we are on currently by holding a
>> pointer to the next element after the current one we are on and freeing
>> with the function, ipmi_free_recv_msg internally in this loop.
>>
>> Signed-off-by: Nicholas Krause <[email protected]>
>> ---
>>  drivers/char/ipmi/ipmi_devintf.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/char/ipmi/ipmi_devintf.c 
>> b/drivers/char/ipmi/ipmi_devintf.c
>> index ec318bf..235a1fa 100644
>> --- a/drivers/char/ipmi/ipmi_devintf.c
>> +++ b/drivers/char/ipmi/ipmi_devintf.c
>> @@ -157,12 +157,17 @@ static int ipmi_release(struct inode *inode, struct 
>> file *file)
>>  {
>>      struct ipmi_file_private *priv = file->private_data;
>>      int                      rv;
>> +    struct  ipmi_recv_msg *msg, *next;
>>  
>>      rv = ipmi_destroy_user(priv->user);
>>      if (rv)
>>              return rv;
>>  
>> -    /* FIXME - free the messages in the list. */
>> +    list_for_each_entry_safe(msg, next, &priv->recv_msgs, link) {
>> +            ipmi_free_recv_msg(msg);
>> +    }
>> +
>> +
>>      kfree(priv);
>>  
>>      return 0;
> 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to