/* This function returns zero in case of success and a %-ENOMEM in case of failure.  */
static int schedule_erase(struct ubi_device *ubi, struct ubi_wl_entry *e, int torture)
/* This function returns zero in case of success and a %-ENOMEM in case of failure.  */
static int schedule_erase(struct ubi_device *ubi, struct ubi_wl_entry *e, int torture)
{
	struct ubi_work *wl_wrk;
	dbg_wl("schedule erasure of PEB %d, EC %d, torture %d",
	       e->pnum, e->ec, torture);
	wl_wrk = kmalloc(sizeof(struct ubi_work), GFP_NOFS);
	if (!wl_wrk)
		return -ENOMEM;
	wl_wrk->func = &erase_worker;
	wl_wrk->e = e;
	wl_wrk->torture = torture;
	schedule_ubi_work(ubi, wl_wrk);
	return 0;
}