forked from Minki/linux
staging: gma500: fix some swapped gotos
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>
This commit is contained in:
parent
1f2b472cc9
commit
0e83f46d38
@ -460,7 +460,7 @@ static int psbfb_create(struct psb_fbdev *fbdev,
|
|||||||
if (!fb) {
|
if (!fb) {
|
||||||
DRM_ERROR("failed to allocate fb.\n");
|
DRM_ERROR("failed to allocate fb.\n");
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out_err0;
|
goto out_err1;
|
||||||
}
|
}
|
||||||
psbfb = to_psb_fb(fb);
|
psbfb = to_psb_fb(fb);
|
||||||
psbfb->size = size;
|
psbfb->size = size;
|
||||||
@ -468,7 +468,7 @@ static int psbfb_create(struct psb_fbdev *fbdev,
|
|||||||
info = framebuffer_alloc(sizeof(struct psb_fbdev), device);
|
info = framebuffer_alloc(sizeof(struct psb_fbdev), device);
|
||||||
if (!info) {
|
if (!info) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out_err1;
|
goto out_err0;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->par = fbdev;
|
info->par = fbdev;
|
||||||
|
Loading…
Reference in New Issue
Block a user