Skip to content

Commit

Permalink
staging: gma500: fix some swapped gotos
Browse files Browse the repository at this point in the history
These gotos were swapped.  In the original code, the first would result
in a NULL dereference and the second would result in a memory leak.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Mar 1, 2011
1 parent 1f2b472 commit 0e83f46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/gma500/psb_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,15 +460,15 @@ static int psbfb_create(struct psb_fbdev *fbdev,
if (!fb) {
DRM_ERROR("failed to allocate fb.\n");
ret = -ENOMEM;
goto out_err0;
goto out_err1;
}
psbfb = to_psb_fb(fb);
psbfb->size = size;

info = framebuffer_alloc(sizeof(struct psb_fbdev), device);
if (!info) {
ret = -ENOMEM;
goto out_err1;
goto out_err0;
}

info->par = fbdev;
Expand Down

0 comments on commit 0e83f46

Please sign in to comment.