lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2750806.COjXX3GeT0@avalon>
Date:	Thu, 16 May 2013 14:50:06 +0200
From:	Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:	Prabhakar Lad <prabhakar.csengg@...il.com>
Cc:	LMML <linux-media@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	DLOS <davinci-linux-open-source@...ux.davincidsp.com>,
	Hans Verkuil <hans.verkuil@...co.com>,
	Mauro Carvalho Chehab <mchehab@...hat.com>,
	Guennadi Liakhovetski <g.liakhovetski@....de>,
	Sylwester Nawrocki <s.nawrocki@...sung.com>,
	Sakari Ailus <sakari.ailus@....fi>,
	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	Rob Landley <rob@...dley.net>,
	devicetree-discuss@...ts.ozlabs.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH v3] media: i2c: tvp514x: add OF support

Hi Prabhakar,

On Thursday 16 May 2013 18:13:38 Prabhakar Lad wrote:
> On Thu, May 16, 2013 at 5:40 PM, Laurent Pinchart wrote:
> > Hi Prabhakar,
> 
> [Snip]
> 
> >> +
> >> +     pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
> >> +     if (!pdata)
> > 
> > I've started playing with the V4L2 OF bindings, and realized that should
> > should call of_node_put() here.
> 
> you were referring  of_node_get() here rite ?

No, I'm referring to of_node_put(). The v4l2_of_get_next_endpoint() function 
mentions

 * Return: An 'endpoint' node pointer with refcount incremented. Refcount
 * of the passed @prev node is not decremented, the caller have to use
 * of_node_put() on it when done.

> of_node_get/put() got recently added I guess coz of which I missed it :)
> 
> >> +             return NULL;
> >> +
> >> +     v4l2_of_parse_endpoint(endpoint, &bus_cfg);
> >> +     flags = bus_cfg.bus.parallel.flags;
> >> +
> >> +     if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
> >> +             pdata->hs_polarity = 1;
> >> +
> >> +     if (flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
> >> +             pdata->vs_polarity = 1;
> >> +
> >> +     if (flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
> >> +             pdata->clk_polarity = 1;
> >> +
> > 
> > As well as here. Maybe a
> > 
> > done:
> >         of_node_put(endpoint);
> >         return pdata;
> > 
> > with a goto done in the devm_kzalloc error path would be better.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ