Skip to content

Commit

Permalink
staging/gdm72xx: use kzalloc for phydev and sdev
Browse files Browse the repository at this point in the history
in sdio probe function we are doing kmalloc which can be done using kzalloc.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Devendra Naga authored and Greg Kroah-Hartman committed Jul 17, 2012
1 parent 8df858e commit c2a1793
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/staging/gdm72xx/gdm_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,20 +664,17 @@ static int sdio_wimax_probe(struct sdio_func *func,
if (ret)
return ret;

phy_dev = kmalloc(sizeof(*phy_dev), GFP_KERNEL);
phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL);
if (phy_dev == NULL) {
ret = -ENOMEM;
goto out;
}
sdev = kmalloc(sizeof(*sdev), GFP_KERNEL);
sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
if (sdev == NULL) {
ret = -ENOMEM;
goto out;
}

memset(phy_dev, 0, sizeof(*phy_dev));
memset(sdev, 0, sizeof(*sdev));

phy_dev->priv_dev = (void *)sdev;
phy_dev->send_func = gdm_sdio_send;
phy_dev->rcv_func = gdm_sdio_receive;
Expand Down

0 comments on commit c2a1793

Please sign in to comment.