Skip to content

Commit b75d7d4

Browse files
Rupesh Gujaregregkh
authored andcommitted
staging: ozwpan: Increment reference counter.
Increment PD reference counter, on every timer event so that we do not loose PD object by mistake. Signed-off-by: Rupesh Gujare <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d236dc1 commit b75d7d4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/staging/ozwpan/ozproto.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ void oz_pd_heartbeat_handler(unsigned long data)
497497
spin_unlock_bh(&g_polling_lock);
498498
if (apps)
499499
oz_pd_heartbeat(pd, apps);
500-
500+
oz_pd_put(pd);
501501
}
502502

503503
/*------------------------------------------------------------------------------
@@ -519,6 +519,7 @@ void oz_pd_timeout_handler(unsigned long data)
519519
oz_pd_stop(pd);
520520
break;
521521
}
522+
oz_pd_put(pd);
522523
}
523524

524525
/*------------------------------------------------------------------------------
@@ -531,6 +532,7 @@ enum hrtimer_restart oz_pd_heartbeat_event(struct hrtimer *timer)
531532
pd = container_of(timer, struct oz_pd, heartbeat);
532533
hrtimer_forward_now(timer, ktime_set(pd->pulse_period /
533534
MSEC_PER_SEC, (pd->pulse_period % MSEC_PER_SEC) * NSEC_PER_MSEC));
535+
oz_pd_get(pd);
534536
tasklet_schedule(&pd->heartbeat_tasklet);
535537
return HRTIMER_RESTART;
536538
}
@@ -543,6 +545,7 @@ enum hrtimer_restart oz_pd_timeout_event(struct hrtimer *timer)
543545
struct oz_pd *pd;
544546

545547
pd = container_of(timer, struct oz_pd, timeout);
548+
oz_pd_get(pd);
546549
tasklet_schedule(&pd->timeout_tasklet);
547550
return HRTIMER_NORESTART;
548551
}

0 commit comments

Comments
 (0)