Re: [PATCH] USB: dummy-hcd: Fix uninitialized array use in init()

2020-12-06 Thread Alan Stern
On Sun, Dec 06, 2020 at 06:24:05PM +0700, Bui Quang Minh wrote: > On Sat, Dec 05, 2020 at 10:15:11AM -0500, Alan Stern wrote: > > On Sat, Dec 05, 2020 at 07:47:01PM +0700, Minh Bùi Quang wrote: > > > Vào Th 6, 4 thg 12, 2020 vào lúc 23:12 Alan Stern > > > đã viết: > > > > Does this

Re: [PATCH] USB: dummy-hcd: Fix uninitialized array use in init()

2020-12-06 Thread Bui Quang Minh
On Sat, Dec 05, 2020 at 10:15:11AM -0500, Alan Stern wrote: > On Sat, Dec 05, 2020 at 07:47:01PM +0700, Minh Bùi Quang wrote: > > Vào Th 6, 4 thg 12, 2020 vào lúc 23:12 Alan Stern > > đã viết: > > > Does this initialization end up using less memory than an explicit > > > memset() call? > > > >

Re: [PATCH] USB: dummy-hcd: Fix uninitialized array use in init()

2020-12-05 Thread Alan Stern
On Sat, Dec 05, 2020 at 07:47:01PM +0700, Minh Bùi Quang wrote: > Vào Th 6, 4 thg 12, 2020 vào lúc 23:12 Alan Stern > đã viết: > > Does this initialization end up using less memory than an explicit > > memset() call? > > You mean speed? No, I mean memory space. A memset call requires a

Re: [PATCH] USB: dummy-hcd: Fix uninitialized array use in init()

2020-12-05 Thread Minh Bùi Quang
Vào Th 6, 4 thg 12, 2020 vào lúc 23:12 Alan Stern đã viết: > Does this initialization end up using less memory than an explicit > memset() call? You mean speed? In my opinion, there is no difference in speed between 2 ways. When I compile this array initialization using gcc 5.4.0, this

Re: [PATCH] USB: dummy-hcd: Fix uninitialized array use in init()

2020-12-04 Thread Alan Stern
On Fri, Dec 04, 2020 at 06:24:49AM +, Bui Quang Minh wrote: > This error path > > err_add_pdata: > for (i = 0; i < mod_data.num; i++) > kfree(dum[i]); > > can be triggered when not all dum's elements are initialized. > > Fix this by initializing all

[PATCH] USB: dummy-hcd: Fix uninitialized array use in init()

2020-12-03 Thread Bui Quang Minh
This error path err_add_pdata: for (i = 0; i < mod_data.num; i++) kfree(dum[i]); can be triggered when not all dum's elements are initialized. Fix this by initializing all dum's elements to NULL. Signed-off-by: Bui Quang Minh ---