aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2008-04-28 05:15:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:41 -0400
commit60c1645dfac320e992bb5635887b7698ae6606bc (patch)
tree31916e1b7b0a42745ba4165e1bb1cc97cbbfb0c2
parent0e27aa3dabb541edee9f23b37114856a528de01e (diff)
drivers/video/uvesafb.c: fix error-path memory leak
Fix bug identified by Daniel Marjamki: `m' is leaked on the error path. Addresses http://bugzilla.kernel.org/show_bug.cgi?id=10452 Cc: Daniel Marjamki <danielm77@spray.se> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: "Randy.Dunlap" <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/video/uvesafb.c7
1 files changed, 4 insertions, 3 deletions
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)
181 /* If all slots are taken -- bail out. */ 181 /* If all slots are taken -- bail out. */
182 if (uvfb_tasks[seq]) { 182 if (uvfb_tasks[seq]) {
183 mutex_unlock(&uvfb_lock); 183 mutex_unlock(&uvfb_lock);
184 return -EBUSY; 184 err = -EBUSY;
185 goto out;
185 } 186 }
186 187
187 /* Save a pointer to the kernel part of the task struct. */ 188 /* Save a pointer to the kernel part of the task struct. */
@@ -205,7 +206,6 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
205 err = cn_netlink_send(m, 0, gfp_any()); 206 err = cn_netlink_send(m, 0, gfp_any());
206 } 207 }
207 } 208 }
208 kfree(m);
209 209
210 if (!err && !(task->t.flags & TF_EXIT)) 210 if (!err && !(task->t.flags & TF_EXIT))
211 err = !wait_for_completion_timeout(task->done, 211 err = !wait_for_completion_timeout(task->done,
@@ -218,7 +218,8 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
218 seq++; 218 seq++;
219 if (seq >= UVESAFB_TASKS_MAX) 219 if (seq >= UVESAFB_TASKS_MAX)
220 seq = 0; 220 seq = 0;
221 221out:
222 kfree(m);
222 return err; 223 return err;
223} 224}
224 225