linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] usb: phy: use kzalloc to allocate struct tegra_usb_phy
@ 2012-12-21  6:34 Venu Byravarasu
  2012-12-21 20:54 ` Stephen Warren
  0 siblings, 1 reply; 5+ messages in thread
From: Venu Byravarasu @ 2012-12-21  6:34 UTC (permalink / raw)
  To: swarren, balbi, gregkh, sshtylyov
  Cc: linux-kernel, linux-usb, Venu Byravarasu

Use kzalloc instead of kmalloc to allocate struct tegra_usb_phy.
This ensures that all function pointers in member u_phy are
initialized to NULL.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
---
This patch is v3 patch for the patch discussed at
http://marc.info/?l=linux-kernel&m=135599303216132&w=2

 drivers/usb/phy/tegra_usb_phy.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/phy/tegra_usb_phy.c b/drivers/usb/phy/tegra_usb_phy.c
index 04bf5d2..dedead5 100644
--- a/drivers/usb/phy/tegra_usb_phy.c
+++ b/drivers/usb/phy/tegra_usb_phy.c
@@ -736,7 +736,7 @@ struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev,
 	int err;
 	u8 index = is_legacy_mode ? 0 : 2;
 
-	phy = kmalloc(sizeof(struct tegra_usb_phy), GFP_KERNEL);
+	phy = kzalloc(sizeof(struct tegra_usb_phy), GFP_KERNEL);
 	if (!phy)
 		return ERR_PTR(-ENOMEM);
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] usb: phy: use kzalloc to allocate struct tegra_usb_phy
  2012-12-21  6:34 [PATCH v3] usb: phy: use kzalloc to allocate struct tegra_usb_phy Venu Byravarasu
@ 2012-12-21 20:54 ` Stephen Warren
  2012-12-24  4:24   ` Venu Byravarasu
  2013-01-12  0:14   ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Warren @ 2012-12-21 20:54 UTC (permalink / raw)
  To: Venu Byravarasu; +Cc: balbi, gregkh, sshtylyov, linux-kernel, linux-usb

On 12/20/2012 11:34 PM, Venu Byravarasu wrote:
> Use kzalloc instead of kmalloc to allocate struct tegra_usb_phy.
> This ensures that all function pointers in member u_phy are
> initialized to NULL.

Seems fine to me. For the record, I'd like to take this through the
Tegra tree with all the other Tegra-related USB patches in order to
manage any dependencies, with the USB maintainers' Acks. Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v3] usb: phy: use kzalloc to allocate struct tegra_usb_phy
  2012-12-21 20:54 ` Stephen Warren
@ 2012-12-24  4:24   ` Venu Byravarasu
  2013-01-12  0:14   ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Venu Byravarasu @ 2012-12-24  4:24 UTC (permalink / raw)
  To: Stephen Warren; +Cc: balbi, gregkh, sshtylyov, linux-kernel, linux-usb

Thanks Stephen.
Venu


> -----Original Message-----
> From: Stephen Warren [mailto:swarren@wwwdotorg.org]
> Sent: Saturday, December 22, 2012 2:25 AM
> To: Venu Byravarasu
> Cc: balbi@ti.com; gregkh@linuxfoundation.org; sshtylyov@mvista.com;
> linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org
> Subject: Re: [PATCH v3] usb: phy: use kzalloc to allocate struct tegra_usb_phy
> 
> On 12/20/2012 11:34 PM, Venu Byravarasu wrote:
> > Use kzalloc instead of kmalloc to allocate struct tegra_usb_phy.
> > This ensures that all function pointers in member u_phy are
> > initialized to NULL.
> 
> Seems fine to me. For the record, I'd like to take this through the
> Tegra tree with all the other Tegra-related USB patches in order to
> manage any dependencies, with the USB maintainers' Acks. Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] usb: phy: use kzalloc to allocate struct tegra_usb_phy
  2012-12-21 20:54 ` Stephen Warren
  2012-12-24  4:24   ` Venu Byravarasu
@ 2013-01-12  0:14   ` Greg KH
  2013-01-12  0:44     ` Stephen Warren
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2013-01-12  0:14 UTC (permalink / raw)
  To: Stephen Warren; +Cc: Venu Byravarasu, balbi, sshtylyov, linux-kernel, linux-usb

On Fri, Dec 21, 2012 at 01:54:55PM -0700, Stephen Warren wrote:
> On 12/20/2012 11:34 PM, Venu Byravarasu wrote:
> > Use kzalloc instead of kmalloc to allocate struct tegra_usb_phy.
> > This ensures that all function pointers in member u_phy are
> > initialized to NULL.
> 
> Seems fine to me. For the record, I'd like to take this through the
> Tegra tree with all the other Tegra-related USB patches in order to
> manage any dependencies, with the USB maintainers' Acks. Thanks.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] usb: phy: use kzalloc to allocate struct tegra_usb_phy
  2013-01-12  0:14   ` Greg KH
@ 2013-01-12  0:44     ` Stephen Warren
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2013-01-12  0:44 UTC (permalink / raw)
  To: Greg KH; +Cc: Venu Byravarasu, balbi, sshtylyov, linux-kernel, linux-usb

On 01/11/2013 05:14 PM, Greg KH wrote:
> On Fri, Dec 21, 2012 at 01:54:55PM -0700, Stephen Warren wrote:
>> On 12/20/2012 11:34 PM, Venu Byravarasu wrote:
>>> Use kzalloc instead of kmalloc to allocate struct tegra_usb_phy.
>>> This ensures that all function pointers in member u_phy are
>>> initialized to NULL.
>>
>> Seems fine to me. For the record, I'd like to take this through the
>> Tegra tree with all the other Tegra-related USB patches in order to
>> manage any dependencies, with the USB maintainers' Acks. Thanks.
> 
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Thanks, applied to Tegra's for-3.9/usb branch.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-12  0:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-21  6:34 [PATCH v3] usb: phy: use kzalloc to allocate struct tegra_usb_phy Venu Byravarasu
2012-12-21 20:54 ` Stephen Warren
2012-12-24  4:24   ` Venu Byravarasu
2013-01-12  0:14   ` Greg KH
2013-01-12  0:44     ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).