On Tue, Mar 5, 2019 at 8:53 AM Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> wrote: > On Tue, Mar 05, 2019 at 12:25:18AM +0000, Cao, Bingbu wrote: > > > struct v4l2_pix_format_mplane *const in = > > > &q[IPU3_CSS_QUEUE_IN].fmt.mpix; > > > struct v4l2_pix_format_mplane *const out = @@ -1753,6 +1754,11 @@ > > > int imgu_css_fmt_try(struct imgu_css *css, > > > &q[IPU3_CSS_QUEUE_VF].fmt.mpix; > > > int i, s, ret; > > > > > > + if (!q) { > > > + ret = -ENOMEM; > > > + goto out; > > > + } > > [Cao, Bingbu] > > The goto here is wrong, you can just report an error, and I prefer it is next to the alloc. > > I agree, the goto is just not needed. Should I remove all the gotos then and do an explicit kfree() in each error path? I'd prefer not to mix the two styles, as that can lead to subtle mistakes when the code is refactored again. Arnd