staging: gma500: fix some swapped gotos
authorDan Carpenter <error27@gmail.com>
Sat, 26 Feb 2011 12:48:12 +0000 (15:48 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 1 Mar 2011 03:00:30 +0000 (19:00 -0800)
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>
drivers/staging/gma500/psb_fb.c

index 94d845740313ff091ee8220dd4a9d4859301c9b3..f67f53b12937c74e522586ecde12d0d699a6d736 100644 (file)
@@ -460,7 +460,7 @@ 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;
@@ -468,7 +468,7 @@ static int psbfb_create(struct psb_fbdev *fbdev,
        info = framebuffer_alloc(sizeof(struct psb_fbdev), device);
        if (!info) {
                ret = -ENOMEM;
-               goto out_err1;
+               goto out_err0;
        }
 
        info->par = fbdev;