All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: phy: using kzalloc instead of kmalloc
@ 2012-12-20  8:25 Venu Byravarasu
  2012-12-20 12:44 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Venu Byravarasu @ 2012-12-20  8:25 UTC (permalink / raw)
  To: swarren, balbi, gregkh; +Cc: linux-kernel, linux-usb, Venu Byravarasu

As Tegra PHY driver open is using kmalloc,
changing it to kzalloc.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
---
This patch is v2 patch for the patch discussed at
http://marc.info/?l=linux-usb&m=135593869431766&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] 3+ messages in thread

* Re: [PATCH v2] usb: phy: using kzalloc instead of kmalloc
  2012-12-20  8:25 [PATCH v2] usb: phy: using kzalloc instead of kmalloc Venu Byravarasu
@ 2012-12-20 12:44 ` Sergei Shtylyov
  2012-12-20 17:26   ` Stephen Warren
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2012-12-20 12:44 UTC (permalink / raw)
  To: Venu Byravarasu; +Cc: swarren, balbi, gregkh, linux-kernel, linux-usb

Hello.

On 20-12-2012 12:25, Venu Byravarasu wrote:

> As Tegra PHY driver open is using kmalloc,
> changing it to kzalloc.

    This description doesn't make sense.

> Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>

WBR, Sergei


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

* Re: [PATCH v2] usb: phy: using kzalloc instead of kmalloc
  2012-12-20 12:44 ` Sergei Shtylyov
@ 2012-12-20 17:26   ` Stephen Warren
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2012-12-20 17:26 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Venu Byravarasu, balbi, gregkh, linux-kernel, linux-usb

On 12/20/2012 05:44 AM, Sergei Shtylyov wrote:
> Hello.
> 
> On 20-12-2012 12:25, Venu Byravarasu wrote:
> 
>> As Tegra PHY driver open is using kmalloc,
>> changing it to kzalloc.

Indeed, better might be:

usb: phy: use kzalloc to allocate struct tegra_usb_phy

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, and hence bogus functions won't be called.

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

end of thread, other threads:[~2012-12-20 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-20  8:25 [PATCH v2] usb: phy: using kzalloc instead of kmalloc Venu Byravarasu
2012-12-20 12:44 ` Sergei Shtylyov
2012-12-20 17:26   ` Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.