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 <[email protected]>
Cc: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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;