Re: [PATCH 02/28] media: ti-vpe: cal: fix error handling in cal_camerarx_create

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomi,

On Mon, Apr 19, 2021 at 11:24:01AM +0300, Tomi Valkeinen wrote:
> On 18/04/2021 02:05, Laurent Pinchart wrote:
> > On Mon, Apr 12, 2021 at 02:34:31PM +0300, Tomi Valkeinen wrote:
> >> cal_camerarx_create() doesn't handle error returned from
> >> cal_camerarx_sd_init_cfg()
> > 
> > This looks good.
> > 
> >> and it always runs all the cleanup/free
> >> functions in the error code path. The latter doesn't cause any issues at
> >> the moment as media_entity_cleanup() is an empty function.
> > 
> > But this was by design. Do you think we could keep
> > media_entity_cleanup() idempotent ? That would simplify error paths (as
> > shown here).
> 
> It isn't documented. I can change the doc for media_entity_cleanup to 
> state it can be called multiple times, if that was the intention, and 
> simplify the error handling here.

That would be my preference. media_entity_cleanup() isn't
performance-sensitive, so I'd favour ease of use and simplicity of error
handling in drivers.

-- 
Regards,

Laurent Pinchart



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux