Skip to content

Commit

Permalink
usb: phy: use kzalloc to allocate struct tegra_usb_phy
Browse files Browse the repository at this point in the history
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>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
  • Loading branch information
Venu Byravarasu authored and Stephen Warren committed Jan 28, 2013
1 parent 16a665f commit 5b26c94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/phy/tegra_usb_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance,
int i;
int err;

phy = kmalloc(sizeof(struct tegra_usb_phy), GFP_KERNEL);
phy = kzalloc(sizeof(struct tegra_usb_phy), GFP_KERNEL);
if (!phy)
return ERR_PTR(-ENOMEM);

Expand Down

0 comments on commit 5b26c94

Please sign in to comment.