]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/rapidio/rio-scan.c
b43legacy: fix use-after-free rfkill bug
[linux-2.6-omap-h63xx.git] / drivers / rapidio / rio-scan.c
index f935c1f71a583db4dff6d14937e972096717f0b7..44420723a359fb578934c05715dc2b9c58a3f480 100644 (file)
@@ -297,11 +297,10 @@ static struct rio_dev *rio_setup_device(struct rio_net *net,
        struct rio_switch *rswitch;
        int result, rdid;
 
-       rdev = kmalloc(sizeof(struct rio_dev), GFP_KERNEL);
+       rdev = kzalloc(sizeof(struct rio_dev), GFP_KERNEL);
        if (!rdev)
                goto out;
 
-       memset(rdev, 0, sizeof(struct rio_dev));
        rdev->net = net;
        rio_mport_read_config_32(port, destid, hopcount, RIO_DEV_ID_CAR,
                                 &result);
@@ -801,9 +800,8 @@ static struct rio_net __devinit *rio_alloc_net(struct rio_mport *port)
 {
        struct rio_net *net;
 
-       net = kmalloc(sizeof(struct rio_net), GFP_KERNEL);
+       net = kzalloc(sizeof(struct rio_net), GFP_KERNEL);
        if (net) {
-               memset(net, 0, sizeof(struct rio_net));
                INIT_LIST_HEAD(&net->node);
                INIT_LIST_HEAD(&net->devices);
                INIT_LIST_HEAD(&net->mports);