Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: ozwpan: Fix wrong error check.

schedule_work() returns true if succeeded & false on failure,
error check was doing exactly reverse.
Also removes extra variable.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Rupesh Gujare and committed by
Greg Kroah-Hartman
dfc065f1 9efed32c

+1 -5
+1 -5
drivers/staging/ozwpan/ozpd.c
··· 261 261 */ 262 262 void oz_pd_destroy(struct oz_pd *pd) 263 263 { 264 - int ret; 265 - 266 264 if (hrtimer_active(&pd->timeout)) 267 265 hrtimer_cancel(&pd->timeout); 268 266 if (hrtimer_active(&pd->heartbeat)) 269 267 hrtimer_cancel(&pd->heartbeat); 270 268 271 269 INIT_WORK(&pd->workitem, oz_pd_free); 272 - ret = schedule_work(&pd->workitem); 273 - 274 - if (ret) 270 + if (!schedule_work(&pd->workitem)) 275 271 oz_pd_dbg(pd, ON, "failed to schedule workitem\n"); 276 272 } 277 273