Skip to contentSkip to conversation

usb: phy: use kzalloc to allocate struct tegra_usb_phy

PATCH Applied Venu Byravarasu 3 participants 5 messages Dec 21, 2012 – Jan 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 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.

---
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(-)
drivers/usb/phy/tegra_usb_phy.c +1 -1
index 04bf5d2..dedead5 100644
@@ -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);
 
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 3 lines · 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.

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.

#2 lore raw

Thanks Stephen.
Venu

Quoted 16 lines

-----Original Message-----
From: Stephen Warren [mailto:[email protected]]
Sent: Saturday, December 22, 2012 2:25 AM
To: Venu Byravarasu
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v3] usb: phy: use kzalloc to allocate struct tegra_usb_phy

Quoted 3 lines · 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.

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.

maintainer Acked-by
#3 lore raw
In reply to Stephen Warren
Quoted 8 lines · Stephen Warren
Quoted 3 lines · 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.

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.

#4 lore raw
Quoted 11 lines · Greg KH
Quoted 8 lines · Stephen Warren
Quoted 3 lines · 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.

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.

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