On Thu, 2011-07-28 at 16:34 +0200, Laurent Pinchart wrote: 
> > -   adp1653_init_controls(flash);
> > +   ret = adp1653_init_controls(flash);
> > +   if (ret)
> > +           goto free_and_quit;
> > 
> >     ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0);
> >     if (ret < 0)
> > -           kfree(flash);
> > +           goto free_and_quit;
> > 
> > +   return 0;
> > +
> > +free_and_quit:
> > +   v4l2_ctrl_handler_free(&flash->ctrls);
> > +   kfree(flash);
> >     return ret;

> What about
>         ret = adp1653_init_controls(flash);
>         if (ret)
>                 goto done;
> 
>         ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0);
> 
> done:
>         if (ret < 0) {
>                 v4l2_ctrl_handler_free(&flash->ctrls);
>                 kfree(flash);
>         }
> 
>         return ret;
There is no difference at first glance. However, your variant is less
straight to understand for my opinion.

-- 
Andy Shevchenko <andriy.shevche...@linux.intel.com>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to