Re: [Suggestion] drivers/usb/renesas_usbhs: pkt is still in use, after it was already free.
Hi Chen Hello Greg Kroah-Hartman: in drivers/usb/renesas_usbhs/mod_host.c, in function usbhsh_queue_done: get ureq from pkt, by using the macro usbhsh_pkt_to_ureq (at line 637) pkt is the sub-object of ureq (line 73..76, line 157..158) free ureq, by calling function usbhsh_ureq_free (at line 655) use kfree to free ureq in function usbhsh_ureq_free (line 184..191) originally ureq is call kzalloc in function usbhsh_ureq_alloc (line 171..179) so pkt also free, too. still use pkt, by calling function usbhsh_endpoint_sequence_save (at line 657) use pkt-zero in funcion usbhsh_endpoint_sequence_save (at line 243) I find it through code review, please help to check this suggestion whether valid. if it was valid: I prefer the relative member to provide relative patch. if can not find relative member, I should try (although it seems not a good idea) Thank you for your review, and nice catch ! I think this is bug, and I didn't notice it. Best regards --- Kuninori Morimoto -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Suggestion] drivers/usb/renesas_usbhs: pkt is still in use, after it was already free.
于 2012年12月10日 08:21, Kuninori Morimoto 写道: Hi Chen Hello Greg Kroah-Hartman: in drivers/usb/renesas_usbhs/mod_host.c, in function usbhsh_queue_done: get ureq from pkt, by using the macro usbhsh_pkt_to_ureq (at line 637) pkt is the sub-object of ureq (line 73..76, line 157..158) free ureq, by calling function usbhsh_ureq_free (at line 655) use kfree to free ureq in function usbhsh_ureq_free (line 184..191) originally ureq is call kzalloc in function usbhsh_ureq_alloc (line 171..179) so pkt also free, too. still use pkt, by calling function usbhsh_endpoint_sequence_save (at line 657) use pkt-zero in funcion usbhsh_endpoint_sequence_save (at line 243) I find it through code review, please help to check this suggestion whether valid. if it was valid: I prefer the relative member to provide relative patch. if can not find relative member, I should try (although it seems not a good idea) Thank you for your review, and nice catch ! I think this is bug, and I didn't notice it. thank you for your reply. is it suitable to help me send patch ? I am not quite expert about it, and also no releative environments. if you will: please mark me as Reported-by in your patch. need not cc to me: I am not reviewer, so I am not suitable to review another maintainers patch else it is my duty to send the relative patch (although it seems not a good idea) thanks. gchen. Best regards --- Kuninori Morimoto -- Chen Gang Asianux Corporation -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Suggestion] drivers/usb/renesas_usbhs: pkt is still in use, after it was already free.
于 2012年12月07日 23:03, Greg KH 写道: On Fri, Dec 07, 2012 at 08:42:25PM +0800, Chen Gang wrote: Hello Greg Kroah-Hartman: in drivers/usb/renesas_usbhs/mod_host.c, in function usbhsh_queue_done: get ureq from pkt, by using the macro usbhsh_pkt_to_ureq (at line 637) pkt is the sub-object of ureq (line 73..76, line 157..158) free ureq, by calling function usbhsh_ureq_free (at line 655) use kfree to free ureq in function usbhsh_ureq_free (line 184..191) originally ureq is call kzalloc in function usbhsh_ureq_alloc (line 171..179) so pkt also free, too. still use pkt, by calling function usbhsh_endpoint_sequence_save (at line 657) use pkt-zero in funcion usbhsh_endpoint_sequence_save (at line 243) I find it through code review, please help to check this suggestion whether valid. I don't know, run the code to see if this is correct or not. Since no relative member reply, I should try (although I have no environments about renesas_usbhs), it is my duty. please wait for some days. thanks greg k-h -- Chen Gang Asianux Corporation -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Suggestion] drivers/usb/renesas_usbhs: pkt is still in use, after it was already free.
On Fri, Dec 07, 2012 at 08:42:25PM +0800, Chen Gang wrote: Hello Greg Kroah-Hartman: in drivers/usb/renesas_usbhs/mod_host.c, in function usbhsh_queue_done: get ureq from pkt, by using the macro usbhsh_pkt_to_ureq (at line 637) pkt is the sub-object of ureq (line 73..76, line 157..158) free ureq, by calling function usbhsh_ureq_free (at line 655) use kfree to free ureq in function usbhsh_ureq_free (line 184..191) originally ureq is call kzalloc in function usbhsh_ureq_alloc (line 171..179) so pkt also free, too. still use pkt, by calling function usbhsh_endpoint_sequence_save (at line 657) use pkt-zero in funcion usbhsh_endpoint_sequence_save (at line 243) I find it through code review, please help to check this suggestion whether valid. I don't know, run the code to see if this is correct or not. greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html