usb: gadget: f_gsi: Do not re-init work in function bind
In one instance one work item is queued to worklist and
INIT_DELAYED_WORK is called on this work and another work
item is getting queued to the same worklist. This is resulting
into work list corruption.
In another instance work item is about to get executed and
INIT_DELAYED_WORK is called on this work which clears the
WORK_STRUCT_PWQ flag from work's data field. As a result when
pwq_activate_delayed_work() gets called get_work_pwq()
returns NULL causing NULL pointer derefernece.
Fix the issue by moving INIT_DELAYED_WORK in gsi_function_init
which would be called only once when gsi instance is allocated.
Add ipc log message in driver unbind before and after
drain_workqueue() call. Fix ipc log message to print proper
return value.
Change-Id: I524c263ce551efdfba1188b58fac43922ebae94e
Signed-off-by:
Hemant Kumar <hemantk@codeaurora.org>
Loading
Please register or sign in to comment