diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index c4f4d7616317..cdbb56edb6cb 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -181,7 +181,8 @@ static int uvesafb_exec(struct uvesafb_ktask *task) /* If all slots are taken -- bail out. */ if (uvfb_tasks[seq]) { mutex_unlock(&uvfb_lock); - return -EBUSY; + err = -EBUSY; + goto out; } /* Save a pointer to the kernel part of the task struct. */ @@ -205,7 +206,6 @@ static int uvesafb_exec(struct uvesafb_ktask *task) err = cn_netlink_send(m, 0, gfp_any()); } } - kfree(m); if (!err && !(task->t.flags & TF_EXIT)) err = !wait_for_completion_timeout(task->done, @@ -218,7 +218,8 @@ static int uvesafb_exec(struct uvesafb_ktask *task) seq++; if (seq >= UVESAFB_TASKS_MAX) seq = 0; - +out: + kfree(m); return err; }